SearchPane loses data and fails to reorder filter items
SearchPane loses data and fails to reorder filter items
Link to test case:
https://live.datatables.net/moxubuxu/1/edit
Error messages shown:
After clicking on the "SEARCH" button and then on the SearchPane's "Aa" or "#" ordering button, the following error message is shown:
VM265 datatables.min.js:40 Uncaught TypeError: Cannot read properties of undefined (reading '1')
at HTMLButtonElement.<anonymous> (VM265 datatables.min.js:40:13649)
at HTMLButtonElement.dispatch (VM265 datatables.min.js:14:39997)
at v.handle (VM265 datatables.min.js:14:37968)
Description of problem:
The first problem is when trying to reorder filter items (see above).
The second problem is as follows:
1) click twice on the "Toggle Scroll" button
2) click on the "SEARCH" button
3) click on the "Toggle Scroll" button
Then the table contains no data anymore.
Replies
On the second problem, one may just...
4) click again on the "SEARCH" button
...to have all the data reappear.
Obviously this workaround (requiring the end-user to do anything) is not an option for me.
But it narrows down the error to a SearchPane bug at initialization of the table.
I have a partial workaround for the 2nd problem, which is to comment out this:
**You can test it here:
https://pilierpublic.com/tmp/datatables/spLostData/
https://pilierpublic.com/tmp/datatables/spLostData/OK
To test, just follow these steps:
1) click on the "SEARCH" button
2) close the SearchPanes window
3) click on the "Toggle Scroll" button
At this stage, the "OK" example shows the data fine except that thead hides all but the 1st column (see the class "dtr-hidden" and style="display: none;").
If you click again on the "Toggle Scroll" button the table header corrects itself.
I have updated the test case to the latest version 2.0.3 of DT :
https://live.datatables.net/moxubuxu/6/
... with exactly the same result, and same partial workaround.
As noted above, the workaround for the second issue is to comment out the SearchPanes configuration for "cascadePanes" and "viewTotal".