Miguel
1
I have a list control that reads from a list, you can edit it in a dialog (this is Plumsail standard behaviour).
This dialog has the usual save and close.
I have included a button of "save and continue", this will not close the dialog.
The problem is that I cannot prevent the dialog from closing.
I have tried these solutions without success.
First one (this works but not in a dialog)
fd.spSaved(function(result) {
result.RedirectUrl = null;
});
Second one, it is not what i want, it opens again, what I look for is not to close the dialog:
fd.spSaved(function (result) {
Dialog.open(webUrl + "/_layouts/15/listform.aspx?PageType=6&ListId=" + listId + "&ID=" + itemId,
{}, null, { width: 800, height: 600, Title: "Planifier RĂ©alisation" });
console.log("Data saved...");
}
Thx in advance.
Hello @Miguel,
You can reopen the dialog after saving the changes. Add this code to the parent form:
window.Dialog = Dialog
window.continueEdit = false;
fd.spRendered(function(){
fd.control('SPDataTable0').$on('change', function(changeData) {
if (continueEdit === true) {
continueEdit = false;
var newItemID = changeData.itemId;
setTimeout(function(){
Dialog.open("https://contoso.sharepoint.com/sites/Main/SitePages/PlumsailForms/ListName/Item/EditForm.aspx?item=" + newItemID,
{ args: 'something' }, function(hasSaved) {
if(hasSaved){
alert('Form in dialog has saved and closed.');
}
else{
alert('Dialog form was closed without saving!');
}
}, { width: 600, height: 600 });
}, 3000);
}
});
});
Update the control name and the form link in the code. Learn how to build a link to the form.
And add this code to the click property of the button on the child form:
window.top.continueEdit = true;
fd.save();