Deleting Item in vLookup child list from DFFS

Forums vLooup for SharePoint Deleting Item in vLookup child list from DFFS

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 5 years ago.

  • Author
    Posts
  • #6391

    Ben H
    Participant

    When I delete an item in a vLookup child list by opening from the parent in DFFS (popup iframe) the parent item is reloaded in full page Display View losing any unsaved changes made to the parent item. Is there a way to stay in the parent item Edit Form after deleting a child (as happens for new or editing the child item)? Thanks

  • #6393

    Alexander Bautz
    Keymaster

    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

You must be logged in to reply to this topic.