Name and save different datatables states

Name and save different datatables states

dmccleandmcclean 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

Answers

  • allanallan Posts: 61,449Questions: 1Answers: 10,055 Site admin

    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 as page.len() and page().

    Allan

  • dmccleandmcclean Posts: 13Questions: 2Answers: 0

    Allan,
    Ok thanks!

    Don

This discussion has been closed.