Hi,
I’m not sure I can do anything about this as by default there is a redirect / refresh when deleting an item or closing a dialog. If you do not have a “Source=SomeURL” in the URL, you will be redirected back to the default list view of the list you deleted the item in.
You might be able to “hack it”, but this would take some custom code.
As a start you can look at this code that hijacks the built in delete function in SP2013 and possibly SP2010? (add it to the DispForm of the item you want to delete):
/* must refer jQuery and spjs-utility.js scripts */
DeleteItemConfirmation = function(){
if(confirm("Are you sure you want to delete this item?")){
var res = spjs_deleteItem({"listName":_spPageContextInfo.pageListId,"id":GetUrlKeyValue("ID")});
if(res.success){
if(GetUrlKeyValue("IsDlg")==="1"){
alert("Item deleted successfully");
window.frameElement.commitPopup(); // < this code will make the parent page refresh...
}else{
alert("add a redirect here..:");
}
}else{
alert("Delete failed with this message:\n"+res.errorText);
}
}
}
Alexander