排序列表数据 [英] Sorting Tabulated Data
本文介绍了排序列表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
For example if I have a table with some data in it.
- 什么是能够通过日期选择器这些信息进行排序的最佳方式?
- 我怎么能做出这样的表接受,如果需要从一个Ajax或JSON提要信息?
我一直在考虑以下问题,因此我对于上面的问题查询:
I have been given the following question hence my query regarding the question above:
在HTML中显示了一组表格数据,其中的数据包含日期。实施日期选择器来过滤表格数据。如果可能允许通过AJAX和JSON源提供的表格数据。
推荐答案
像@Tats_innit的评论说,你可以使用 tabsorter 插件来实现这一点。使用这个插件很简单,加载js文件只需使用后
Like @Tats_innit said in the comment you can use tabsorter plugin to accomplish this. Using this plugin is easy, after loading the js files just use this
$('table.bordered').tablesorter({
// include zeba widgets
widgets: ['zebra'],
sortList: [[0, 0], [2, 0]]
});
它会自动和排序检测日期栏根据最新的订单。
It detect date columns automatically and sort according to date orders.
您可以检查你怎么能添加AJAX读入数据到这里
You can check how can you append ajax fetched data into it here
http://tablesorter.com/docs/example-ajax.html
这篇关于排序列表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文