简体   繁体   English

jquery排序和过滤表

[英]jquery sort & filter table

I have a problem with sorting and filtering html table. 我有一个排序和过滤html表的问题。

I use jQuery propdown Table Filter plugin and it works perfectly well for me, but, 我使用jQuery propdown Table Filter插件 ,它对我来说非常好用,但是,

For now it looks like this: 现在它看起来像这样:

在此输入图像描述

But problem is i also need sort my table by values (AZ/ZA) , and I'm not strong via JQuery to re-write this plugin. 但问题是我还需要按值(AZ/ZA)排序我的表,并且我不是很强大,通过JQuery重新编写这个插件。 It must look like this (add sorting options to select): 它必须如下所示(添加排序选项以供选择):

在此输入图像描述

Can you give me direction, where I can look? 你能告诉我方向吗,我可以看看哪里? I find a lot of jQuery plugins, but none did what I need. 我找到了很多jQuery插件,但没有一个能做我需要的。

have you perhaps thought of using JQuery Datatables?? 您是否想过使用JQuery Datatables? They are really easy to use and you can sort your columns and filter the data (search box performs filter on all columns based on input text) by default. 它们非常易于使用,您可以对列进行排序并过滤数据(搜索框根据输入文本对所有列执行过滤)默认情况下。

http://www.datatables.net/ http://www.datatables.net/

For the Above sorting you can check ascii value of the character and then sort the character according to it. 对于Above排序,您可以检查字符的ascii值,然后根据它对字符进行排序。

For the NON English character, find the ascii value and then sort it. 对于非英语字符,找到ascii值然后对其进行排序。

For eg 例如

"ABCDEF".charCodeAt(0)  // return 65

Same way for 同样的方式

"CÃNT".charCodeAt(1) // return 195

May this will help you 愿这对你有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM