How would I change the color and text of the searchbuilder filter button when a filter is applied?
How would I change the color and text of the searchbuilder filter button when a filter is applied?
woodsalexj
Posts: 21Questions: 6Answers: 0
https://datatables.net/extensions/searchbuilder/examples/customisation/buttonText.html
Using the above example as a reference.
Thanks!
This question has an accepted answers - jump to answer
Answers
Annoyingly, you should be able to add a class to the button in
searchBuilder.filterChanged
, but I've just noticed a bug which means that it's not being called when SearchBuilder is a button! I've raised it internally (DD-2440 for my reference) and we'll report back here when there's an update.Cheers,
Colin
Thanks! You guys are awesome!
Hi @woodsalexj ,
I've taken a look at the bug colin created and worked out that it does actually work, you just need to remember to initialise the filterChanged function in the buttons config!
Take a look at this example.
Thanks,
Sandy
Sorry, just realised that I linked to the wrong example so have updated the link above!
I'm not sure the example is right. It seems to be searchpanes not searchbuilder, and I can't see that the button changes color either, when a filter is selected.
Thanks
@woodsalexj You might've caught this before Sandy updated the link - this is the correct link which is definitely SearchBuilder: http://live.datatables.net/riruxupe/1/edit
Colin
... and if no joy, here's another: http://live.datatables.net/hesibili/1/edit