Tablesorter Filter widget stops working after update on all browsers, no error msg

前端 未结 3 1403
栀梦
栀梦 2021-01-23 09:52

I\'m trying to see how I can fix a problem that I\'m having with jQuery Tablesoter widget called \'filter\', it stops working after the table is updated without any error messag

相关标签:
3条回答
  • 2021-01-23 10:10

    There is a lot of code to wade through, but you might want to try updating the table contents like this:

    var $table = $("table.tablesorter");
    $table.find('tbody').html(data);
    $table.trigger("update", [true]);
    

    I'm only guessing that the replaceWith() function isn't working as intended.

    0 讨论(0)
  • 2021-01-23 10:14

    It looks like the plugin needed to know that we made an update and I just needed to trigger the updateAll command.

    Like this:

    var resort = true, // re-apply the current sort
        callback = function(){
        // do something after the updateAll method has completed
        };
    
     $("table").trigger("updateAll", [ resort, callback ]);
    
    0 讨论(0)
  • 2021-01-23 10:21

    Same problem here.

    Short solution: make the filter-select to a filter-match class, then the table will work again.

    Long solution: Does anyone have a working example of table sorter combined with ajax pager and filter plugin?

    0 讨论(0)
提交回复
热议问题