The above code snippet can get you going with the dialog box in no time. You can control the fields and you can listen on events raised on them
Prevent Window Auto Close
If you would like to do some validations before the user window is closed, you can declare the onclick function with three params. The third param, usually named close_dialog is a function which when invoked will actually close the dialog/modal.
If the third function was declared and was not called, the modal will not close.
1
...
2
3
primary_button:{
4
label:"Save",
5
onclick:(core, doc, close_dialog)=>{
6
if(core.model.saveDoc(doc)){
7
// the window can close now.
8
close_dialog()
9
}else{
10
// something went wrong, let user recheck what he entered