Updating jQuery Tablesorter plugin after removing a row from DOM

前端 未结 7 635
迷失自我
迷失自我 2020-11-30 07:40

I have some code at the moment that hides a row that is deleted and then removes it using the .remove() function.

However I\'m having difficulty is making it remain

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 08:11

    I found a solution that worked for me:

    var usersTable = $(".tablesorter");
    usersTable.trigger("update")
      .trigger("sorton", [usersTable.get(0).config.sortList])
      .trigger("appendCache")
      .trigger("applyWidgets");
    

    Put this after the place where you've edited the table.

提交回复
热议问题