Basic javascript post around refreshing a modal dialog's parent page. For some reason I didn't find much help online even though such a common function. The dialog options have a property called "diaglogReturnValueCallback" where you can create a delegate callback to another function - remember that this function must exist on the same page. Then inside the Callback function I check whether the dialog result is "Ok" and then I call location.reload(true); Here's the code
//set the callback delegate
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
// the callback function
function CloseCallback(result, target)
{
if (result == SP.UI.DialogResult.OK)
{
location.reload(true);
}
}
//set the callback delegate
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
// the callback function
function CloseCallback(result, target)
{
if (result == SP.UI.DialogResult.OK)
{
location.reload(true);
}
}
No comments:
Post a Comment