An simple dialog which is made by Modal, working as js Alert.
Dialog is an simple component enhanced by modal.
Enable dialog via JavaScript:
$.dialog(options, callback);
Options should be passed via JavaScript.
Name | type | default | description |
---|---|---|---|
title | string | Set the title of dialog window. | |
content | string | Set the content of dialog window. You can also set content as dom element. | |
close | boolean | true | Display the close button. |
confirm | boolean | false | Set dialog mode as confirm. You can get the resault by callback function. |
And other options is same in Modal Component. |
Event | Description |
---|---|
callback |
It will trigger event when user close this dialog.
Parameter return true if click confirm button in confirm dialog, else return false .
You can return false to avoid dialog close.
|
$.dialog({ title: "Comfirm", content: "Do You want to confirm?", confirm: true, }, function(ret){ // ret is true if user click 'confirm' button. });