sharepoint ribbon功能区如何弹出模式框页面。?
比如,我点击上传文档,, 他会弹出upload.aspx,如果我自定义了一个ribbon,如何弹出我自己的页面呢?求代码怎么弄呢,大侠们帮帮忙。
[解决办法]
Ribbon怎么添加不用说了吧?
<CommandUIHandler Command="Ribbon.ChangeManagement.TaskTools.CancelTaskCommand"
CommandAction="
var options = SP.UI.$create_DialogOptions();
options.width = 500;
options.height = 600;
options.url = “你的页面URL”;
SP.UI.ModalDialog.showModalDialog(options);
" ></CommandUIHandler>
[解决办法]
自己添加以下JS到你的母版中最好,以后这些函数通用了:
function portal_openModalDialog(url, width, height, showMax, showClose) {
var options = { width: width, height: height, allowMaximize: showMax, showClose: showClose };
SP.UI.ModalDialog.commonModalDialogOpen(url, options, portal_modalDialogClosedCallback, null);
}
function portal_modalDialogClosedCallback(result, value) {
//if (result == 100) location.reload();
}
然后
<CommandUIHandler
Command="myTestCommand"CommandAction="javascript:open_sp_modalDialog('Test.aspx',800,500);" />