Redirect / Close all Dialogs after deleting item
Hi,
i have following problem:
i open a normal "SP.UI.ModalDialog.showModalDialog" with de default "Display" form of an item ("Dialog1" for example)
Inside this dialog there is a button to open the Edit-Form in a new dialog ("Dialog2"):
This "formUrl" is pointing to the SPForm "Edit" and user can edit the item.
The "formUrl" contains the "Source" parameter to redirect user to current page (top-window) (if i dont provide this, user is redirected to the items list if deleting an item).
All fine.
"Close", "Cancel", "Save" => all working correct and closing all modal dialogs ("Dialog1" and "Dialog2").
If the user hit the "Delete Item" button in Ribbon, the spform is closing, but "Dialog2" and "Dialog1" are still open, but "Dialog2" is now empty.
How can i catch the delete event and close all dialogs after successfull deleted item...
Thx a lot!
i have following problem:
i open a normal "SP.UI.ModalDialog.showModalDialog" with de default "Display" form of an item ("Dialog1" for example)
Inside this dialog there is a button to open the Edit-Form in a new dialog ("Dialog2"):
Code: Select all
SP.UI.ModalDialog.showModalDialog(
{
url: formUrl,
title: "Edit item",
dialogReturnValueCallback: closeContactDialog,
});
...
function closeContactDialog(){
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel,"Close dialog");
}
The "formUrl" contains the "Source" parameter to redirect user to current page (top-window) (if i dont provide this, user is redirected to the items list if deleting an item).
All fine.
"Close", "Cancel", "Save" => all working correct and closing all modal dialogs ("Dialog1" and "Dialog2").
If the user hit the "Delete Item" button in Ribbon, the spform is closing, but "Dialog2" and "Dialog1" are still open, but "Dialog2" is now empty.
How can i catch the delete event and close all dialogs after successfull deleted item...
Thx a lot!
Hello ragesoft,
You can use this code to detect when the Delete button in the ribbon is clicked:
You can use this code to detect when the Delete button in the ribbon is clicked:
Code: Select all
var button = $( "a[aria-describedby='Ribbon.ListForm.Edit.Actions.DeleteItem_ToolTip']" );
$(button[0]).on('click', function() {
console.log(true)
})
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests