You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a request to make a dynamic sortAppend. Here is the request:
I've got 3 column table(status, date, doc type), clicking on status should sort status & date, clicking on date should sort date & doc type, clicking on doc type should sort doc type & date.
So basically there is a default sortAppend option on the date column, but when the date colum is sorted first, add a different secondary sort.
The sortStart event doesn't work in this case because the sortList isn't defined at that point. The sortEnd event won't work, because, well the sort is already done.
The text was updated successfully, but these errors were encountered:
I added a new event named sortBegin which occurs immediately before the sort begins and after the sortList variable has been updated in the configure options. This allows us to dynamically change the sort order. Here is a demo and the basic code:
$('table').bind('sortBegin',function(e,tbl){varc=tbl.config,list=c.sortList;// add third column sort if not the initial sort, otherwise sort second column// (zero based index)list.push((list[0]&&list[0][0]!==2) ? [2,0] : [1,0]);});
I have a request to make a dynamic
sortAppend
. Here is the request:So basically there is a default
sortAppend
option on the date column, but when the date colum is sorted first, add a different secondary sort.The
sortStart
event doesn't work in this case because the sortList isn't defined at that point. ThesortEnd
event won't work, because, well the sort is already done.The text was updated successfully, but these errors were encountered: