Pass Page Number to Querystring?
Pass Page Number to Querystring?

Just wondering if there's a way to pass the Page number in the querystring (i'm using Server Side) so that after an action, I can return to that location in the Paged List?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The server side protocol is described here. The server side parameters contain
start
andlength
parameters. In your server script you can dividestart
bylength
to get the page number. Or you can use theajax.data
option as a function and pass thepage()
value for the page number.Kevin
Yes, I have all that working, I just wanted to knwo wehther there was an option to be able to see the params via QueryString so I could easily send a user back to a specific page.
Someone else maybe able to answer this but I'm not familiar with QueryString.
Are you asking because you are using using either
draw()
orajax.reload()
and the table shows page one instead of the page the user is on? If so both have parameters to force saying on the page.Kevin
I must be explaining this wrong. In this example, I go to Page 2, but the paging mechanism is hidden from the user. I was just wonder in the was a simple way to add code to the pager, so that when it is click, the Page and take and added to the QueryString so I i send a user to Index?Page=2
Sorry I'm still not clear on how you want to use the QueryString.
Use the
page()
API to programmatically change the Datatable page. See this example:http://live.datatables.net/qofajube/1/edit
If this doesn't help please provide a link to your page or a test case (update mine if you want) to show what you are trying to accomplish.
Kevin
Deep linking might help, see blog post here. You might also want to look at
stateSave
, as that will return the user to the same page.Colin