tablesorter serverSideSorting的推荐工作流程?

时间:2018-06-04 20:31:37

标签: tablesorter

Mottie's tablesorter 2.30.5版的问题。

serverSideSorting的推荐工作流程是什么?更具体地说,何时/如何应用/插入/更新从服务器返回的表数据,以便我不会消除像last.sortList这样的信息?

我尽可能地关注Mottie的answer here,但我无法对多列进行排序,因为当我重新初始化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
    });

0 个答案:

没有答案