Hi,
Today I've been testing the Dialog module in a new site I'm working on. I've review the example modules and the module implementation and it's fits pretty well my requirements. However, I've a problem I don't know how to solve.
When creating an AJAX display command in order to open a dialog you can set options like 'width', 'height', 'closeOnEscape', etc. When testing the 'buttons' option, in order to add some buttons to the jQuery dialog attached to submit buttons in a form included in the dialog contents, I found the problem.
The 'click' property for the dialog buttons is a JS callback function. That's the first problem: when the JSON is generated using the drupal_json_output, the callback functions are not correctly rendered. That's annoying, but I implemented a workaround based on this post. Now the JSON is correctly generated, but on the client side an AJAX 'parsererror' is raised.
So, is there any recommended way of adding buttons to a dialog and set the behaviour of those buttons adding JS for the click event?
Thank you! :)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | buttons.patch | 2.03 KB | robloach |
| #1 | buttons.patch | 1.81 KB | robloach |
Comments
Comment #1
robloachThe click event doesn't invoke the submit button for some reason. Maybe need to change to submit?
Comment #2
jantimon commentedThe Drupal ajax frameworks does not use 'click' but 'mousedown'.
However this can be changed for every form element.
Comment #3
robloachNot sure if it's working yet.
Comment #4
nagiek commentedSetting status for the bot :)
Comment #5
yannickooThis module doesn't contain any tests so you don't have to change the status for the bot ;)
The patch moves the buttons correctly but nothing happens when clicking on a button, we should work on this, right?
Comment #6
devin carlson commentedThe 7.x-1.x branch of the Dialog module is unsupported.