SearchBuilder Delete Condition Bug
SearchBuilder Delete Condition Bug
![mooncoffeemermaid](https://datatables.net/forums/uploads/userpics/549/nKGF6FS8MMS3V.jpg)
Good day,
I was wondering if someone could help with a bug I'm experiencing with deleting an empty/not empty condition.
To duplicate this problem:
1. Navigate to https://datatables.net/extensions/searchbuilder/examples/performance/searchBuilder50k.html
2. Press "Add Condition"
3. For the "Data" dropdown choose "Name"
4. For the "Condition" dropdown choose "Empty"
5. Press the "x" to delete the filtering rule (The table will not reflect the change and the filter will not be completely cleared)
Link to test case: https://datatables.net/extensions/searchbuilder/examples/performance/searchBuilder50k.html
Debugger code (debug.datatables.net): Problem is re-producible following provided steps on searchbuilder example.
Error messages shown: Uncaught TypeError: Cannot read properties of undefined (reading 'off')
at c.destroy (dataTables.searchBuilder.min.js:25:152)
at HTMLButtonElement.<anonymous> (dataTables.searchBuilder.min.js:119:445)
at HTMLButtonElement.dispatch (jquery-3.5.1.js:5429:27)
at elemData.handle (jquery-3.5.1.js:5233:28)
Description of problem: When deleting an "Empty" or "Not Empty" filter condition from the search builder the error above is thrown and the table does not work until refreshed or Clear All is pressed. (If using stateSave, refreshing results in the conditions coming back)
Does anyone know of a solution for this?
Answers
Thank you for those steps on how to reproduce - I agree, something is definitely wobbly there. I've raised it internally (DD-2571 for my reference) and we'll report back here when there's an update.
Cheers,
Colin
FYI - This is still happening. I noticed it occurring with a custom condition I created and the same issue with the example noted above. This appears to be the code firing off the exception (I'm guessing because that element doesn't exist in the case of an "Empty" condition or similar?):
@colin to check and see if this is still on the radar.
Hi,
Apologies this one did slip off the radar. It is fixed now and SearchBuilder 1.4.2 has just been released with the fix.
Regards,
Allan