Pregunta

Estoy tratando de encontrar una solución o mejor manera de hacerlo, básicamente tengo visio web de acceso web en la página en sí misma, debido al diseño de la página, solo se muestra en forma pequeña, decidimos hacer un botón para hacer clic eny amplíelo en modo completo, consciente de que use el visiowebaccess.aspx basado para llamar al archivo de visio, pero no deseamos que se muestre el botón de la barra de herramientas.

Preguntas: ¿Hay alguna pregunta para el visiowebaccess.aspx que pueda ser usado?¿O existe de todos modos para el diálogo modal de SharePoint para inyectar algún javascript?

Código como tal:

// 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);
}

gracias.

¿Fue útil?

Solución

Parece que me he encontrado una solución: En lugar de usar la página de VisiowebAccess, cree una nueva página en blanco con solo la parte web de Visio, use el contenedor-fluido si su sitio de SharePoint tiene Bootstrap (que tiene la mina), al llamar al Pase modal en la URL de archivo a través de la Página de la Consulta y en la Página MODALIncluye este ScrPt:

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);
}

Licenciado bajo: CC-BY-SA con atribución
scroll top