开发者

jQuery: Enable sorting on a table and keeping it sorted while inserting new rows

开发者 https://www.devze.com 2022-12-31 06:18 出处:网络
I have a tab开发者_StackOverflow社区le with data and I want the user to be able to sort it in different ways. I have tried the tablesorter plugin for jQuery, but there are some issues I can\'t quite f

I have a tab开发者_StackOverflow社区le with data and I want the user to be able to sort it in different ways. I have tried the tablesorter plugin for jQuery, but there are some issues I can't quite figure out of.

What I am struggling with is how to insert new rows while keeping the table sorted according to how the user currently have chosen. The best would be if the table had a method I could call to just insert the row where it should go.

Another issue with this is that I want the row to light up or something to let the user know where his new row went.

Anyways, does anyone know how to do this in a good way using the tablesorter plugin? Or do you know of a better plugin that handles this better?


I use datatables for problems like this. See the function fnAddData(), which takes in a boolean indicating whether or not to resort and refilter the table.

0

精彩评论

暂无评论...
验证码 换一张
取 消