Invalid searchPanes options should not be restored from stateSave

Invalid searchPanes options should not be restored from stateSave

pgerundtpgerundt Posts: 90Questions: 13Answers: 2

Hi guys,

another one to go:
http://live.datatables.net/jexikuxe/2/edit

1) Load the page and select a searchPane filter option
2) Reload the page
-> "No matching records found"

searchPanes options from the previously saved state should not be set if this option is no longer present.
(eg. having a table with dynamically removed rows.)

Greetings,
Pascal

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,177Questions: 1Answers: 2,590
    Answer ✓

    Yep, that's a pretty convincing test case, thanks for that. I've raised it internally (DD-2516 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @pgerundt ,

    Sorry for the delay in getting this fix made. That should be the issue fixed now as you can see at this example. This will be available in the next SearchPanes release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • tefdattefdat Posts: 42Questions: 7Answers: 3

    Hi,
    for me the v2.0.2 does not work. I have exactly the same case / issue.
    1)If keepStates is On
    2)if I a put something in one of the searchPanes filter
    3)reload page -> "no matching records found"

    After reload you dont see even the search term in searchPanes filter.
    It seems, thats this is been stored here:

    A workaround which can be executed on page reload:

                        const locStorage = { ...localStorage };
                        Object.entries(locStorage).forEach(([key, value]) => {
                            if (key.includes('DataTables_DataTables_Table_')) {
                                let val = JSON.parse(value);
                                localStorage.setItem(key, JSON.stringify({ ...val, search: { search: '' } }));
                            }
                        });
    
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Have you tried the nightly version?

    Allan

  • tefdattefdat Posts: 42Questions: 7Answers: 3

    To be honest, no. I took the latest release DT v1.12.1 from 19th May, which appeared after Sandy's post. I probably ignored that the release of DT has nothing to do with the searchPanes release.)
    I just compared the Nightly with Winmerge; oh yes, a lot has changed. I'll try it later. Ashes on my head.

  • tefdattefdat Posts: 42Questions: 7Answers: 3

    @allan sorry for offtopic - is there a kind of issue tracker or a draft release note for the nightlys of DT and its extensions available public?

Sign In or Register to comment.