Mehrere SP.UI.ModalDialog.showModalDialog - CallBack
When several SP.UI.ModalDialog.showModalDialog window placed on a page, it is important that the callback methods are called differently. Otherwise, works only one dialog callback. Therefore, use the Properties dialogue always a different method name.
If you are using multiple windows SP.UI.ModalDialog.showModalDialog on your page, be aware to have different callback methods defined. Otherwise there will be just one call back working. Therefore set in the properties of your dialog always a different method.
Dialogue 1:
OpenDialog1 function () {
were options = {
url: '/ _layouts / MyDialog.aspx',
title: 'MyDialog',
allowMaximize: false, show close: true,
width: 400, height: 400,
dialog return value callback: DialogCallback1};
function DialogCallback1 (dialogue result, the return value) {
[Your code on callback]
}
Dialogue 2:
OpenDialog2 function () {
each option = {
url: '/ _layouts / MySecondDialog.aspx',
title: 'MySecondDialog',
allowMaximize: false
show close: true,
width: 400,
height: 400,
dialog ReturnValue callback: DialogCallback2};
SP.UI.ModalDialog.showModalDialog (options);
}
function (DialogResult, returnValue) DialogCallback2 {
[ Your code on callback]}
There is still a different spelling ->
There is therefore another way of defining the dialog ->
Dialogue 1:
OpenDialog1 function () {
SP.UI.ModalDialog . showModalDialog (options);
var options = $ SP.UI. create_DialogOptions ();
options.url = '/ _layouts / MyDialog.aspx';
options.width = 400;
options.height = 400;
options.allowMaximize = false;
options.showClose = true;
options.dialogReturnValueCallback = DialogCallback1;
SP.UI.ModalDialog.showModalDialog (options); ") ;}
function DialogCallback1 (dialogue result, the return value) {
[Your code on callback]
}
Dialogue 2:
OpenDialog2 function () {
SP.UI.ModalDialog.showModalDialog (options);
each option = SP.UI. $ create_DialogOptions ();
options.url = '/ _layouts / MySecondDialog.aspx';
options.width = 400;
options.height = 400;
options.allowMaximize = False;
options.showClose = true;
options.dialogReturnValueCallback = DialogCallback2;
SP.UI.ModalDialog.showModalDialog (options);}
DialogCallback2 function (dialog result, return value) {
[Your code on callback]
}
0 comments:
Post a Comment