State Restore - looping through states and filter data - Page 2

State Restore - looping through states and filter data

2»

Answers

  • allanallan Posts: 65,649Questions: 1Answers: 10,918 Site admin

    Hi Ben,

    Are you able to give me a link to a page that is showing that issue?

    Allan

  • bg7bg7 Posts: 115Questions: 14Answers: 0

    Allan,

    I wish I could but unfortunately it's not possible. For what it's worth, this is the config I'm using:

                        extend: 'savedStates',
                        config: {
                            ajax: {
                                url: 'gridDetails/stateRestore',
                                submitAs: 'json',
                            },
                            creationModal: true,
                            saveState: {
                                select: false,
                            },
                        },
    

    And I added this just in case so I'd sleep better at night.

                stateSaveParams: function (s, data) {
                    delete data.select;
                },
    

    I don't think there's anything else unusual that I'm doing. It's pretty simple now that I'm able to use your built-in ajax config (which is great). That screenshot I posted of the network traffic was from before I added the stateSaveParams. And I admittedly had trouble reproducing it.

    For what it's worth I asked Copilot to trace this for me and see if there really is a path through the code that could explain what I saw. Now please take this with a very large grain of salt as my experience has been that if I ask it enough times Copilot will tell me the sky is green if I want. That said, it did tell me what I'm seeing is possible and gave me an explanation. Mind you, the line numbers probably aren't going to be super helpful given that my version is from the download builder which I then replaced the State Restore code with your nightly build by hand. Hopefully there's enough context in the description that it's useful. But if this is garbage (definitely in the realm of possibility) then feel free to ignore it.

    If none of that is useful and you feel the DataTables code is good then worst case is I have a stateSaveParam with a redundant delete and that's fine. I just figured I should pass along what I saw just in case.

    Thanks.

    Ben

Sign In or Register to comment.