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?

woodsalexjwoodsalexj Posts: 21Questions: 6Answers: 0

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    edited January 2022

    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

  • woodsalexjwoodsalexj Posts: 21Questions: 6Answers: 0

    Thanks! You guys are awesome!

  • sandysandy Posts: 913Questions: 0Answers: 236
    edited January 2022

    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

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Sorry, just realised that I linked to the wrong example so have updated the link above!

  • woodsalexjwoodsalexj Posts: 21Questions: 6Answers: 0

    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

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    @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

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    ... and if no joy, here's another: http://live.datatables.net/hesibili/1/edit

Sign In or Register to comment.