SharePoint 2013 Visio Web Access模态对话框 - 帮助
-
29-09-2020 - |
题
我试图找到解决方案或更好的方法,基本上我在页面本身中有Visio Web Access WebPart,由于页面布局只以小形式显示,我们决定有一个按钮单击并以全模式扩展它,我知道使用基于Visiowebaccess.aspx来调用Visio文件,但我们不希望将工具栏按钮显示为。
问题:可以使用的Visiowebaccess.aspx有任何QueryString吗?或者是否有SharePoint模态对话框将注入一些JavaScript?
代码如此:
// Hook into the AJAX Sys.Application.load event.
Sys.Application.add_load(onApplicationLoad)
// Define global variables.
var vwaControl;
var webPartElementID;
var drawingURL ;
var vwaPage;
// Capture a reference to the current session of the Visio Web Access Web Part.
function onApplicationLoad() {
try{
webPartElementID = getVWAWebPartID();
vwaControl= new Vwa.VwaControl(webPartElementID);
drawingURL = vwaControl.getDiagramUrl();
vwaPage = vwaControl.getActivePage();
}
catch(err){
console.log(err);
$("#btn_visioModal").hide();
}
}
// Search the SharePoint page to get the WebPartID# for the Visio Web Access Web Part.
function getVWAWebPartID() {
// Get a NodesList of all the div tags on the page.
var divArray = document.getElementsByTagName("div");
var webPartElementID;
// Iterate through the NodesList to get the node with the class attribute "VisioWebAccess."
for (var i = 0; i < divArray.length; i++) {
var node = divArray[i];
// Return the first instance of the Visio Web Access Web Part.
if (node.className == "VisioWebAccess") {
webPartElementID = node.parentNode.parentNode.id;
break;
}
}
return webPartElementID;
}
function openInDialog() {
try{
// Get the URL for the drawing currently displayed in the Visio Web Access Web Part.
drawingURL = vwaControl.getDiagramUrl();
// Setup option for the modal dialog
var options = {url: "http://sharepointportal/_layouts/15/VisioWebAccess/VisioWebAccess.aspx?id="
+ drawingURL,
width: 1280,
height: 768,
allowMaximize: false,
showClose: true};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
catch(err){
console.log(err);
}
.
谢谢。
解决方案
似乎我发现了自己解决方案: 而不是使用VisiOWebaccess页面,只需使用Visio Web部件,使用Container-Fluid创建一个新的空白页面,如果SharePoint站点具有Bootstrap(哪个矿区),请在通过查询和模态页面调用文件URL中的模态传递时包括此SCPT:
function changeUrl(){
// Get the URL of the current file being displayed.
fileURL = GetQueryStringParams('fileURL');
var currDiagram = vwaControl.getDiagramUrl();
currDiagram = currDiagram.replace("%20", " ");
fileURL = decodeURI(fileURL);
console.log(vwaControl.getDiagramUrl());
console.log(fileURL);
// Replace the currently displayed Web Drawing with the other Web Drawing.
vwaControl.openDiagram(fileURL);
}
.