tablesorter - tablesorter serverSideSorting 的推荐工作流程?
问题描述
Mottie 的 tablesorter 版本 2.30.5 的问题。
serverSideSorting 的推荐工作流程是什么?更具体地说,何时/如何应用/插入/更新从服务器返回的表数据,这样我就不会清除 last.sortList 之类的信息?
我在这里尽可能地关注 Mottie 的回答,但我无法对多个列进行排序,因为当我重新初始化 tablesorter 时,它会清除 last.sortList。
jQuery("#search_results_table")
.on("sortEnd", function(e, table) {
jQuery('#search_sort').val(JSON.stringify(table.config.sortList));
// yuck
if (gTableSorterReady) {
// call server here, which calls this code on completion
}
})
.on("tablesorter-ready", function(e) {
// yuck
gTableSorterReady = true;
})
.tablesorter({
theme : 'search-theme',
widgets : [ 'zebra', 'stickyHeaders' ],
widthFixed : false,
widgetOptions : {
stickyHeaders_attachTo: '#search_results_container',
},
cssAsc : "headerSortUp",
cssDesc : "headerSortDown",
cssHeader : "header",
sortList : inSortList,
serverSideSorting: true
});
解决方案
推荐阅读
- react-native - 在滚动视图中反应原生 100% 宽度视图
- c# - AppDomain 有什么替代品吗?
- lodash - Loadash过滤器需要得到完全匹配
- python - I need to read 100000 lines of a txt file and add each line into a array
- c++ - std::stringstream::flush() 应该做任何事情吗?
- javascript - 使用 forEach 将 100 添加到可被 3 整除的数组值
- javascript - Can someone help me understand the output of the following code?
- flutter - 在 Flutter 中首次重新加载应用程序时获取旧 UI
- angular - Access FormControl inside custom Angular Component
- javascript - 在没有提交表单jsp的情况下使用表单中的按钮