Hi All,
I am trying to use UI dialog to create a modal dialog. The dialog workscorrectly, and all is well. I close the dialog using the "X" in the corner. I tried using dialog('destroy').remove(); , but then of course I can't open it again. I think I just don't understand how to reinitialize the dialog and do not have the old values in it.
function CreateWorkBoard()
{ var jsmarty = WMCreateSmartyObject(); var param = { MY_NAME1:GLOBAL_MY_NAME1, MY_NAME2:GLOBAL_MY_NAME2, LANG_NAME:LANGUAGE_NAME, BOARD_DIALOG_TITLE:WM_LANG_BOARD_DIALOG_BOARD_DIALOG_TITLE, BOARD_TITLE: WM_LANG_BOARD_DIALOG_BOARD_TITLE, COMMENT_TITLE:WM_LANG_BOARD_DIALOG_COMMENT_TITLE, MEMBERS_TITLE:WM_LANG_BOARD_DIALOG_MEMBERS_TITLE, CANCEL_BUTTON:WM_LANG_BOARD_DIALOG_CANCEL_BUTTON, REGISTER_BUTTON:WM_LANG_BOARD_DIALOG_REGISTER_BUTTON
};
jsmarty.assign('LANG', param);
var divValue = WMSmartyFetch(jsmarty, 'createBoardDialog.tpl');
document.getElementById('CREATE_DIALOG').innerHTML = divValue;
jsmarty.clear_all_assign();
//alert(document.getElementById('CREATE_DIALOG').innerHTML);
//alert(divValue);
//$.ui.dialog.defaults.bgiframe = true;
//alert(document.getElementById('New_WorkBoard_Dialog').innerHTML);
$('#New_WorkBoard_Dialog').dialog({
autoOpen: false,
height: 530,
width:300,
modal: true,
resizable:false,
buttons: {
Cancel: function() {
$(this).dialog('close');
//$('#New_WorkBoard_Dialog').dialog('destroy');
},
'Register board': function() {
var board_name=document.getElementById("name");
var comments=document.getElementById("comment");
Createboard(board_name,comments);
$(this).dialog('close');
}
},
close: function() {
}
});
$('#New_WorkBoard_Dialog').dialog('open');
}