Name and save different datatables states
Name and save different datatables states
dmcclean
Posts: 13Questions: 2Answers: 0
During a session with the datatable, allow a user to name and save the curent state of the table (search params,ordering etc).
These would be saved to a database. Each user would have their own list of saved states.
Later, the use could pick from a list of the saved states and restore it.
Has anyone done something like this? I imagine I would use the stateLoadCallback method to load from the database. Is this the best approach?
Thanks and Regards
Don
This discussion has been closed.
Answers
The
state()
method is the one you want to get the current state of the DataTable. There isn't yet an inverse of that function to load a state though - but you could readily use the properties in the state saved object to be loaded in using the API methods such aspage.len()
andpage()
.Allan
Allan,
Ok thanks!
Don