最近使用jquery tablesorter,遇到了一个问题,需要删除tbody中的内容,重新从网络读取,然后加载排序,百度好久都没找解决办法,没办法,只能看官网文档了
官网帮助地址
找了好久终于找到了配置
$("#myTable1 tbody").empty();
$("#myTable1 tbody").append(html);
**$("#myTable1").trigger("updateCache");**
$("#myTable1").trigger("update");
加粗的这部分很关键,官网是这么说的:
updateCache Update the parsers, only if not defined, then update the internal cache (v2.15.4).
它更新了tablesorter自己维护的数据,将最新的数据放到了内置存储中,并且删除了老的数据
jquery tablesorter动态更新表格
最新推荐文章于 2023-01-03 12:13:43 发布