Open SharePoint popup/dialog using java script:
//Place below code in Content Editor Web part
//Pass list item id to the function
<a href='#' onclick='openpopupdialog(" + id + ")'>See full item>></a>
function openpopupdialog(id) {
options = SP.UI.$create_DialogOptions();
options.url = 'http://sp2010.com/sites/subsite/Lists/fame/DispForm.aspx?isDlg=1&ID=' + id;
options.height = 650;
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
void (SP.UI.ModalDialog.showModalDialog(options))
}
function CloseCallback(result, target) {
location.href = window.location.href;
}
//Place below code in Content Editor Web part
//Pass list item id to the function
<a href='#' onclick='openpopupdialog(" + id + ")'>See full item>></a>
function openpopupdialog(id) {
options = SP.UI.$create_DialogOptions();
options.url = 'http://sp2010.com/sites/subsite/Lists/fame/DispForm.aspx?isDlg=1&ID=' + id;
options.height = 650;
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
void (SP.UI.ModalDialog.showModalDialog(options))
}
function CloseCallback(result, target) {
location.href = window.location.href;
}
Comments
Post a Comment