Searchpanes cleared after JavaScript acts on the data
Searchpanes cleared after JavaScript acts on the data
Hello
I'm using code very similar to https://datatables.net/manual/plug-ins/search#Example, which runs perfectly (in my case it is also the age of persons). When I added SearchPanes those SearchPanes display nicely if both input fields are empty or if I enter a value in the "maximum" field (#max).
But: All three SearchPanes clear completly "No matching records found" if I enter a value in the minimum field, independant of the entered value. In both cases the DataTable itself shows the correct number of rows
I cannot make this DataTable visible publically, due to privacy restrictions, sorry
Please advise if and where I could help with some debug-output
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
You don't need to use "live" data when creating a test case.
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
Hi @MartinZ,
We will need to see a test case in order to help with this I'm afraid. As @tangerine has pointed out, we don't need a link to your page. Please could you try to replicate the issue at http://live.datatables.net/ ? On this page you can use our example data rather than your own.
You can find more Information on how to create a test case (if you aren't able to link to the page you are working on) here.
You'll find here a live.datatable here (hoepfully I did it right)
http://live.datatables.net/qexuboho/1/
http://live.datatables.net/qexuboho/1/edit?html,css,js,console,output
The strange behaviour from my post is reproduced, please enter any value in box "minimum" and you'll see all three searchpanes getting empty. The rows in the main datatable correct reflect the minimum value.
Enter a maximum value and the searchpanes fill appropriatly
Hi @MartinZ ,
Sorry for the delay in getting back to you. Something isn't right there. I've raised an issue internally (DD-1629 for my reference) and will report back here when there is an update.
Thanks,
Sandy
Hi @MartinZ ,
The fix for this actually lies within the search function that you are creating. Because that search function is applying to all DataTables on the page it is also being applied to the SearchPanes DataTables. You need to add a check in your function to make sure that it isn't being applied to the tables without SP (which are the SearchPanes tables)
Take a look at this example.
Hope this helps,
Sandy
Hi @Sandy Oh silly me, it is written everywhere, that the SearchPanes are DataTables, and my search function did not check against the "wrong" DataTable.
I took your example and it runs like a charm, thx
Martin