I’m trying since yesterday how to close external dialog after click on button
this shows dialog:
<div id="external_dialog"
data-dojo-type="dijit.Dialog"
title="Edytuj dane firmowe"
href="/external/dialog"
style="overflow:auto; width: 365px; height: 280px;">
</div>
and the dialog in external file is just a simple form
<form data-dojo-type="dijit.form.Form">
<script type="dojo/event" data-dojo-event="onSubmit" data-dojo-args="e">
dojo.stopEvent(e);
if(!this.isValid()){ return; }
$.post('ajax/something',
{name: $('#FM-name').val()},
function() {
alert('ok')
});
</script>
<table cellpadding="0" cellspacing="2" style="width: 330px">
<tr>
<td valign="top"><strong>Company name: </strong></td>
<td><input type="text" required="true" name="name" id="FM-name" placeholder="" dojoType="dijit.form.ValidationTextBox"/></td>
</tr>
</table>
<input type="submit" value="Submit" id="FC-submit" dojoType="dojox.form.BusyButton" label="Submit" busyLabel="Please wait..." />
<input type="button" value="Close" label="Close" id="FC-close" dojoType="dijit.form.Button"} />
</form>
BTW. submit works perfectly, but what should be related with close button?
Best regards
You can get a reference of the dialog first using
dijit.byId, then usehidefunction to hide the dialog.In the click event handler of the close button, try