Destroy the dialog.
Parameters
Name | Type | Description |
---|---|---|
keepHtml | {boolean} | If this flag is set to false, the dialog html markup will be removed from the HTML dom tree. |
Examples
Keep HTML Markup
<div id="dialog" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit...</div>
<button onclick="create()" class="gj-button-md">Create</button>
<button onclick="dialog.destroy()" class="gj-button-md">Destroy</button>
<script>
var dialog;
function create() {
dialog = $('#dialog').dialog();
}
</script>
Remove HTML Markup
<div id="dialog" style="display: none">Lorem ipsum dolor sit amet, consectetur adipiscing elit...</div>
<button onclick="create()" class="gj-button-md">Create</button>
<button onclick="dialog.destroy(false)" class="gj-button-md">Destroy</button>
<script>
var dialog;
function create() {
if ($('#dialog').length === 0) {
alert('The dialog can not be created.');
} else {
dialog = $('#dialog').dialog();
}
}
</script>