Pass Page Number to Querystring?

Pass Page Number to Querystring?

timcadieuxtimcadieux Posts: 76Questions: 22Answers: 0

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

Answers

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    The server side protocol is described here. The server side parameters contain start and length parameters. In your server script you can divide start by length to get the page number. Or you can use the ajax.data option as a function and pass the page() value for the page number.

    Kevin

  • timcadieuxtimcadieux Posts: 76Questions: 22Answers: 0

    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.

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    params via QueryString

    Someone else maybe able to answer this but I'm not familiar with QueryString.

    I could easily send a user back to a specific page.

    Are you asking because you are using using either draw() or ajax.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

  • timcadieuxtimcadieux Posts: 76Questions: 22Answers: 0

    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

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    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

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    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

This discussion has been closed.