1

On a SharePoint 2010 site how can I create an "Add New Item" link to the quick launch that will refresh the parent page when the new item is submitted?

I have used the following snippet to create the link:

JavaScript:var options=SP.UI.$create_DialogOptions();
options.url='http :// someurl.somedomain.com';
options.height = 400;
void(SP.UI.ModalDialog.showModalDialog(options))

but this does not refresh the parent page. So when the end-user submits their item they don't see the new item in the list.

1
  • 1
    You would need a callback function to refresh the page. How to do that in a quick launch link, I do not know. Here's info on modal callbacks – wjervis Aug 21 '14 at 16:00
0

This would refresh the page if the parent was closed via a submit button and not by clicking on the 'X'. Clicking on the 'X' would not refresh the page.

var options=SP.UI.$create_DialogOptions();
options.url='';
options.height = 400;
options.dialogReturnValueCallback = function(dialogResult) {SP.UI.ModalDialog.RefreshPage(dialogResult)};
void(SP.UI.ModalDialog.showModalDialog(options));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.