ColumnControl SearchList Options for Ajax Not Updating Correctly
ColumnControl SearchList Options for Ajax Not Updating Correctly

Link to test case: https://live.datatables.net/dowucoxu/2/
Description of problem:
The options for searchList are not correctly updating when Ajax data is updated.
The test case https://live.datatables.net/dowucoxu/2/ demonstrates this issue.
Action | Category SearchList Expected Result | Category SearchList Actual Result | Status |
---|---|---|---|
Initial load - Fragrances are loaded | fragrances | fragrances | ✅ |
Click on the "All" button | beauty, fragrances, furniture, groceries | fragrances | ❌ |
Click on the "Beauty" button | beauty | beauty, fragrances, furniture, groceries | ❌ |
Click on the "Fragrances" button | fragrances | beauty | ❌ |
Observations:
The searchList options are getting updated after the next Ajax call.
As a result, the searchList options show the options for the previous Ajax call.
Ajax source data is viewable at these links:
https://dummyjson.com/products/category/fragrances
https://dummyjson.com/products/category/beauty
https://dummyjson.com/products
Answers
Hi,
Many thanks for the test case and clear description of the problem! I've committed a fix for the problem - the issue was a timing one for the case when the options aren't provided in the Ajax data. When the list was attempting to get the data for what options to show, it still had the old data in the table. It needs to wait for a
draw
. It means that in the case of the options being provided in the JSON, that will works, but just a fraction of a second later, which is fine.This will be in the next release
.
Allan
Thank you for the quick fix, Allan!