Pagination question
Pagination question
I've got a table using DataTables. All is good.
One of my users today presented me with a minor irritant. Here's what happens:
1. User clicks a link in the table on phones.php
2. This opens phoneline.php which is a page that allows editing of a record
3. User clicks save on phoneline.php which returns to phones.php
4. User is dismayed to find that they are no longer on page 4 of phones.php (using the DataTable pagination functionality) and bugs me about it.
My question: Is there a way to save the state of the DataTable on a page (in a cookie perhaps?!) so that when returning to that same page, the DataTable is re-presented in the same state it was before leaving the page? IF the cookie had a very short expiry (say 5 minutes - more than enough time to edit a phoneline record).
Down the road, I'd like to convert my system so that the phoneline.php page opens via AJAX in the same page, thus rendering this discussion moot, but for now, my hands are tied.
One of my users today presented me with a minor irritant. Here's what happens:
1. User clicks a link in the table on phones.php
2. This opens phoneline.php which is a page that allows editing of a record
3. User clicks save on phoneline.php which returns to phones.php
4. User is dismayed to find that they are no longer on page 4 of phones.php (using the DataTable pagination functionality) and bugs me about it.
My question: Is there a way to save the state of the DataTable on a page (in a cookie perhaps?!) so that when returning to that same page, the DataTable is re-presented in the same state it was before leaving the page? IF the cookie had a very short expiry (say 5 minutes - more than enough time to edit a phoneline record).
Down the road, I'd like to convert my system so that the phoneline.php page opens via AJAX in the same page, thus rendering this discussion moot, but for now, my hands are tied.
This discussion has been closed.
Replies
Hope that helps,
Allan
When was this feature added?
And then I checked the change history on the download page http://datatables.net/download
and noticed this in the 1.4.2 changes: "Fixed: State saving javascript error"
So that's why it's not working. :)
Regards,
Allan
Thanks for your prompt responses.