ajax deep linking

ajax deep linking

lynnlynn Posts: 7Questions: 0Answers: 0
edited September 2012 in DataTables 1.9
I am using server side processing.

How do I provide a link to a specific page after the user has used filters and pagination and sorting?

Because datatables is using AJAX the URL never changes and the user can't book mark a page or share the link to specific pages.

Thanks.

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You need to use the API to apply a filter and sort based on the information in the link - this isn't a built in feature, but is easily done with fnFilter / fnSort .

    Allan
  • lynnlynn Posts: 7Questions: 0Answers: 0
    Thanks.

    Datatables is an amazing tool but I feel this is a very crucial missing feature.

    Is there any example code using your suggestion to accomplish my goal?

    Has anyone tried to create a plugin using http://www.asual.com/jquery/address/ or something similar?

    If no to both questions then I think I will provide a button that converts the cookie to a link and then convert the link back to a cookie.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    No to both I'm afraid. You can use the API to get the state of the table, and listen for events such as page to update the history / url. It would also need to manipulate the init options to reflect the URL - should all be quite possible, but it might require a few hundred lines of code. The DataTables developer docs will probably be useful to you: http://datatables.net/docs/DataTables

    Allan
This discussion has been closed.