Keeping Sort/page/number displayed when returning from edit page

Keeping Sort/page/number displayed when returning from edit page

morismoris Posts: 3Questions: 0Answers: 0
edited November 2009 in General
Hi

Can someone please help? I have an edit/delete field in each row of the table and when clicked goes to the edit/delete pages accordingly. My problem is that when I return to the page my original parameters, if I had set the number of pages to displayed, sort etc are reset.

Is there a way to retain these setting?

Moris

Replies

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi Moris,

    So when you edit the record the browser goes to a different url, rather than some Ajax stuff? In that case bStateSave might do just what you are looking for - http://datatables.net/usage/features#bStateSave

    Regards,
    Allan
  • morismoris Posts: 3Questions: 0Answers: 0
    Thank you. However, it does not seem to work- just added the bit of code as under
    [code]

    $(document).ready(function() {
    $('#GridView1').dataTable( {'bStateSave': true} );
    } );

    [/code]

    If I go to another page and come back the no of items show,filter etc are not resored when I come back.

    Anything else I need to do?

    Regards

    Moris
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi Moris,

    No - that should do it. Here is a live example: http://datatables.net/examples/basic_init/state_save.html

    Are you able to link us to an example which isn't state saving?

    it's worth noting hat there is a known problem with state saving when it tries to store more than 4K of data (which you can't do). This is something I'm looking at how to fix, but browser bugs are making it difficult. This only happens when you have a lot of different tables on your site though.

    Regards,
    Allan
This discussion has been closed.