Searchbuilder's custom condition doesn't show when it's in "modal" mode

Searchbuilder's custom condition doesn't show when it's in "modal" mode

keytrapkeytrap Posts: 15Questions: 2Answers: 2

Link to test case: https://live.datatables.net/lokidevu/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
When I set the searchbuiler to appear as a modal instead of being on the page, the condition "+-5" doesn't appear.
Or is it something that I don't understand ?

Replies

  • allanallan Posts: 63,262Questions: 1Answers: 10,423 Site admin

    No that's weird. I would have fully expected it to show there as well. I'll get back to you on this one.

    Allan

  • keytrapkeytrap Posts: 15Questions: 2Answers: 2
    edited June 10

    I have found that if you put the config IN the button, it works :
    But i'm not sure if it's the way to go. I would've thought that the searchbuilder, even in modal, would inherit of the global searchbuilder's config.

    https://live.datatables.net/dubevewa/1/edit

  • allanallan Posts: 63,262Questions: 1Answers: 10,423 Site admin

    Just been looking at the test case, and it actually works - it doesn't have quite the same code as in the gif above. I think you found the answer - SearchBuilder's custom conditions are on a per instance basis (at least when configured like this), but the searchBuilder button doesn't extend from the top level searchBuilder option! You need to do as you have done and extend the button:

        buttons: [{
            extend: 'searchBuilder',
            config: {
                conditions: {
                    "num-fmt": {
    

    Allan

Sign In or Register to comment.