Abort sorting
Abort sorting
John Archer
Posts: 56Questions: 1Answers: 0
Hi there!
We want to gather certain information of the sorting event. So we bound the event like this to our datatable:
[code].bind('sort', function (a, b) {
}[/code]
Is there a way to _stop_ the actual sorting somewhere/in the sort event, so we can just use the information (which header was clicked, sort direction - even for mulitsort) but don't want DataTables to do the acutal sort (for now)?
Or is the only way to achieve this using the fnDrawCallback and stop drawing if we encountered that we sorted?
Thanks a lot!
Regards
We want to gather certain information of the sorting event. So we bound the event like this to our datatable:
[code].bind('sort', function (a, b) {
}[/code]
Is there a way to _stop_ the actual sorting somewhere/in the sort event, so we can just use the information (which header was clicked, sort direction - even for mulitsort) but don't want DataTables to do the acutal sort (for now)?
Or is the only way to achieve this using the fnDrawCallback and stop drawing if we encountered that we sorted?
Thanks a lot!
Regards
This discussion has been closed.
Replies
With the callback function you could either use the oSettings.bSorted parameter, or set a flag using your sort event listener.
The other option is it unbind the DataTables sort events and then add your own and call fnSort whenever you want the table to actually do the sort.
Allan
ok, thanks a lot for all that useful information. We'll have a look into this.
Regards!