jquery - TableSorter - when creating new child rows, it is ignored by the sorter -
tablesorter works child rows - need give child tr
tablesorter-childrow
class , parent tr
tablesorter-haschildrow
class, , table sorter able sort table while ignoring child rows...
however, when creating new children on fly using jquery, tablesorter no longer ignores these newly created children...
when trying sort new table (i.e. after creating children), newly created children pushed top of table , rest of table sorted normal.
this demonstrated jsfiddle: https://jsfiddle.net/szzp0aq9/1/
is possible tablesorter ignore these newly generated child rows?
edit
background: had empty hidden child rows under each row show()
when required...
however, table produced program can quite large, on 5000 rows, these empty hidden rows increases file size quite bit... trying see if create these rows when required , still keep table sorter happy...
(btw, html file produced program viewed on local machine , not uploaded onto internet)
when new row added, tablesorter internal cache needs updated. in order this, you'll need trigger "update" method (demo)
function childrow(source, target) { var childrowid = '#' + target; // ... code add rows $('table').trigger('update'); }
Comments
Post a Comment