How to access and/or save sorting/filtering on current grid?
How to access and/or save sorting/filtering on current grid?
I'm in a position where I need to save the current "view" or state of a datatable and be able to apply that saved view at a later date on demand.
Per user, they will be able to save any given view/state of their grid and then on a single click, bring any given saved view back with fresh data.
I can walk the headers to find the current structure of the grid, but how can I go about accessing the sorting of each column as well as any filtering?
Thanks in advance.
Per user, they will be able to save any given view/state of their grid and then on a single click, bring any given saved view back with fresh data.
I can walk the headers to find the current structure of the grid, but how can I go about accessing the sorting of each column as well as any filtering?
Thanks in advance.
This discussion has been closed.
Replies
Will be interesting to know how you get on with this.
Regards,
Allan
This is what I was looking for. Thanks for your reply though. :)
var settings = oTable.fnSettings();
var sorting = settings.aaSorting[0];
var sortedColumn = sorting[0];
var sortedDirection = sorting[1];