Shraepoint 2010 OpenPopUpPageWithTitle 中的回调选项
Callback option in Shraepoint 2010 OpenPopUpPageWithTitle
我调用了 OpenPopUpPageWithTitle 方法,通过一个简单的 HTML 按钮弹出一个新的列表项表单。它做了我想要的一切,除了回调。弹出页面关闭后,我试图从父页面调用自定义 JS 函数(只是一个带有一些消息的对话框)。我应该在哪里放置(或注入)自定义 JS 函数以便回调可以找到它?请注意,我只能使用 Sharepoint Designer。非常感谢。
回调函数应该在您调用的同一范围内定义 OpenPopUpPageWithTitle()
。
(function(){
// do stuff
// invoke your modal dialog
OpenPopUpPageWithTitle("http://www.bing.com",myCallBack,500,300,"My Dialog");
// do other stuff
// define the call back function within the same scope:
function myCallBack(){
alert("Success!");
}
})();
或者您可以使用内联匿名函数:
OpenPopUpPageWithTitle("http://www.bing.com",
function(){
alert("Success!");
},500,300,"My Dialog");
我调用了 OpenPopUpPageWithTitle 方法,通过一个简单的 HTML 按钮弹出一个新的列表项表单。它做了我想要的一切,除了回调。弹出页面关闭后,我试图从父页面调用自定义 JS 函数(只是一个带有一些消息的对话框)。我应该在哪里放置(或注入)自定义 JS 函数以便回调可以找到它?请注意,我只能使用 Sharepoint Designer。非常感谢。
回调函数应该在您调用的同一范围内定义 OpenPopUpPageWithTitle()
。
(function(){
// do stuff
// invoke your modal dialog
OpenPopUpPageWithTitle("http://www.bing.com",myCallBack,500,300,"My Dialog");
// do other stuff
// define the call back function within the same scope:
function myCallBack(){
alert("Success!");
}
})();
或者您可以使用内联匿名函数:
OpenPopUpPageWithTitle("http://www.bing.com",
function(){
alert("Success!");
},500,300,"My Dialog");