SearchBuilder button submits

SearchBuilder button submits

LimpEmuLimpEmu Posts: 65Questions: 18Answers: 1

Description of problem: My datatables setup includes editor which requires a form that processes the updates facilitated through editor. I found that clicking on the logic button AND in the top left corner of the searchBuilder pane to switch from AND to OR results in submitting the form, see attached screenshot.

The button type
$(".dtsb-logic.dtsb-button").attr("type")
shows as undefined, in other words, the default button type "submit" is used which is why the submission occurs.

I can modify this behavior by assigning the type attribute button in the developer console after the searchBuilder pane opens
$(".dtsb-logic.dtsb-button").attr("type","button");
but obviously this has to happen each time the searchBuilder pane opens.

Is it possible to make sure that clicking on the logic buttons does not submit any forms?

Many thanks for your feedback.
Beate

This question has an accepted answers - jump to answer

Answers

  • LimpEmuLimpEmu Posts: 65Questions: 18Answers: 1

    I went through datatables.searchBuilder.js and added type="button" to all buttons that did not have that attribute. That solved my problems for now.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @LimpEmu ,

    I'm going to look into that, it sounds like something we should fix. I've raised an issue internally (DD-1732 for my reference) and will report back here when there is an update. This will probably be towards the end of next week.

    Thanks,
    Sandy

  • LimpEmuLimpEmu Posts: 65Questions: 18Answers: 1

    Thank you, @sandy !

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

    Hi @LimpEmu ,

    That should be the issue fixed now. This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • LimpEmuLimpEmu Posts: 65Questions: 18Answers: 1

    Yes, just tried it, and the nightly build addresses my problem. Thank you!

This discussion has been closed.