DateTables saveState

DateTables saveState

jdadwilsonjdadwilson Posts: 80Questions: 14Answers: 1

I am in the process of implementing the HTML5 History API across my website. As such I am using the saveState: true parameter on one of my main DataTable. In testing I noticed that the saveState works fine with FireFox but does not work with Chrome or IE. Is this a know issue, and if so is there a solution?

Example: www.txfannin.org/interments.php?cem_id=3 -> select one of the letters to display new records -> select an individual to display their burial information -> select the back button.

With FireFox the table displayed is for the selected letter. With Chrome/IE the table display is the initial load.

TIA for any assistance
jdadwilson

Replies

  • allanallan Posts: 61,879Questions: 1Answers: 10,138 Site admin

    Hi,

    I'm afraid your page doesn't appear to work for me in Chrome or Firefox. Nothing appears to be pushed to the history (url doesn't change) and on reload the state isn't retained.

    I think the reason for that is:

    "saveState": true,

    should be stateSave.

    Allan

  • jdadwilsonjdadwilson Posts: 80Questions: 14Answers: 1

    My bad on the 'stateSave: true,' I made the change and it still works in FireFox and not Chrome. Not sure what you mean by 'Nothing appears to be pushed to the History...'. Anything pushed to the History would be a function of the browser given that the URL does change from 'interment.php?cem_id=3' to 'obit.php?per=nnnnn' where nnnnn is the GenWeb number. From the Obit page, pushing the 'Back' button on FireFox causes the return to the 'interments' page at the selected page (stateSave) position. On Chrome the 'interments' page is reloaded to the initial 'All' state.

    Thanks for your reply
    jdadwilson

  • allanallan Posts: 61,879Questions: 1Answers: 10,138 Site admin

    Apologies - I was slightly confused earlier and was expecting history to be pushed as the table's state was modified.

    The state saving of DataTables does appear to be working in Chrome and Firefox. If you change the table to show page 2 using the paging control and then reload the page it will restore to page 2. Likewise the global search input.

    This is not the case for the alphabet filter. Unfortunately the alphabet filter does not currently implement state saving which I think would be required for this to work.

    I think that Firefox has better restoration of previously visited pages which is why you are seeing a different between the two browsers.

    Allan

  • jdadwilsonjdadwilson Posts: 80Questions: 14Answers: 1

    Given the ability to work with using the search box will satisfy my customer but not entirely. Is it possible to implement the stateSave option into the Alphabet area? That would be ideal.

    Thanks again for a great product and support.
    jdadwilson

  • allanallan Posts: 61,879Questions: 1Answers: 10,138 Site admin
    edited June 2016

    Certainly possible and happy to do it at the start of the week under the Quick Support 60 option. I've added it to my to do list, but I'm afraid I can't commit to when I'll have time to do it without it being "sponsored".

    If you fancy trying it, use the state save events that [DataTables presents](/reference/events]. Specifically look into stateSaveParams and stateLoadParams.

    Allan

  • jdadwilsonjdadwilson Posts: 80Questions: 14Answers: 1

    Given that my work is gratis and the client is a non-profit organization the Quick Support 60 option is not available. Have you been able to implement the solution otherwise?

    I note that the problem now seems to have degraded. Whereas before the issue did not arise if the Alpha buttons were not used, that is no longer the case in Chrome. Firefox works fine.

    Thanks again for a great product and support.
    Just to highlight my use of your product, there are 50+ uses on the main site and another 50+ in the Admin area.

    jdadwilson

  • allanallan Posts: 61,879Questions: 1Answers: 10,138 Site admin

    Hi,

    I'm afraid I've not had time in the last month to be able to implement that change.

    Regards,
    Allan

This discussion has been closed.