Close dialog on return in Buttons mode

Close dialog on return in Buttons mode

gstowegstowe Posts: 2Questions: 1Answers: 0

I'm using the SearchBuilder in Button mode, so it opens a dialog and have it set up to query on return instead of every keypress. I'd like to close the dialog on return, but there doesn't seem to be anything in the API or events to handle this. Any suggestions?

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @gstowe ,

    I don't think there is a way to do this using the DataTables api directly. You could do something like in this example.

    It's a bit convoluted, but in effect when the a button is pressed a listener is set on any searchbuilder condition select elements that are being displayed. Then when a change is made in one of them, a listener is set for any searchbuilder input elements that are displayed. Then you can listen for a keypress and if it is enter, click the background to close the popover.

    Not the cleanest solution but it does work!

    Thanks,
    Sandy

  • gstowegstowe Posts: 2Questions: 1Answers: 0

    I can make that work, thanks!

Sign In or Register to comment.