dimanche 1 février 2015

Hide ribbon in a modal pop up dialog

I'm having an issue trying to hide the ribbon when the modal displays as a pop up.


Here is what I have tried so far. Within the JavaScript I call this



function MyJSMethodWithCallBack() {
var dialogOptions = {
url: 'newpage.aspx',
dialogReturnValueCallback: function (dialogResult) {
//Where you can do additional JS function base on the dialogResult.
SP.UI.ModalDialog.RefreshPage(dialogResult);
}
};
OpenPopUpPageWithDialogOptions(dialogOptions);
HideRibbon();
}

function HideRibbon() {
$('.ms-dlgFrame').load(function () {
console.log("This enters the Hide Button");
$('#s4-ribbonrow').hide();
});
}


The comment within hide-button does get displayed, but the ribbon is still displaying. This is a webpart page in sharepoint 2013. I'm guessing the page is loading before the hide can occur? What should I do differently?


Aucun commentaire:

Enregistrer un commentaire