Loading a record/row after update
Loading a record/row after update
jeffbourassa
Posts: 1Questions: 0Answers: 0
I am working with a simple datatable sample/test site.
I have a simple Table with 100 rows, loading this table with datatables, everything working. On this table I have an Edit link - clicking that takes the user to a edit page to update that row, on submit I then reload the main table/datatable page. However I have lost "where the user was", I would like the reload to return back to the page, record/row/view (with sorts, search, #/per page) settings as they were with the updated record display (maybe even highlighted).
For instance, user pages to page 3, 10 per page, selects row 3 to edit. After they update I would like them to see to reloaded datatable with that row highlighted, and on page 3.
Is this possible? Any ideas on where to start?
Jeff
I have a simple Table with 100 rows, loading this table with datatables, everything working. On this table I have an Edit link - clicking that takes the user to a edit page to update that row, on submit I then reload the main table/datatable page. However I have lost "where the user was", I would like the reload to return back to the page, record/row/view (with sorts, search, #/per page) settings as they were with the updated record display (maybe even highlighted).
For instance, user pages to page 3, 10 per page, selects row 3 to edit. After they update I would like them to see to reloaded datatable with that row highlighted, and on page 3.
Is this possible? Any ideas on where to start?
Jeff
This discussion has been closed.
Replies
1. Enable state saving (ideally with localStorage: http://datatables.net/blog/localStorage_for_state_saving )
2. Read the current state variables from DataTables when the click is made, pass them through to your edit page, and then pass them back to the DataTable page and use the initialisation parameters (such as iDisplayStart ) to restore the state.
Allan