jQuery: Enable sorting on a table and keeping it sorted while inserting new rows
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.
精彩评论