Exclude a column from being sorted using jQuery tablesorter

后端 未结 8 1788
有刺的猬
有刺的猬 2021-02-01 21:30

I am looking for a way to exclude a single column from being sorted using jQuery\'s tablesorter plugin. Specifically, I have a fairly large table and would like to keep a \"row

8条回答
  •  遇见更好的自我
    2021-02-01 22:02

    Hrm. From tablesorter's method of reorganizing the table, I'm pretty sure that this isn't entirely possible. Tablesorter pulles each tr out of the DOM one by one and sorts them based on an indexed field, reinserting the entire tr without changing the tr's contents in any way. Your requested solution would then need to iterate back through the table after each sort and re-enumerate the first column. Tablesorter does have a plugin method, which is used by the zebrastripe and other extensions. Perhaps this could be used to hook the sort methods?

提交回复
热议问题