Home › Forums › Classic DFFS › Build in CheckOut function – how to… ?
- This topic has 5 replies, 3 voices, and was last updated 7 years ago by
Alexander Bautz.
-
AuthorPosts
-
-
August 17, 2017 at 15:52 #17779
Hi!
I’m really thankful for this build in checkout function, though there are two things my client asked about and I’m not sure how to do this (without messing with the function)
1. Is there a possiblitly to remove the Keep checked out after saving checkbox? (see the pic) My client doesn’t want this option available for the users.
I deleted the lable text but the checkbox is still there.2. Is it possible to check in the item (or undo the checkout) if the edit mode is left through the cancel button and not saved? As it is now, only the save button does checkin the item again 🙁
Thanks
BR,
NicoleAttachments:
-
August 17, 2017 at 16:02 #17786
Forgot to add the Verion info
Attachments:
-
August 22, 2017 at 07:57 #17895
Hi,
we have excactly the same requirment.This is the solution we use:
Custom JS:
$(window).bind("beforeunload",function(event) { if(dffs_beforeunload){ var res = spjs_updateItem({"listName":"MYDFFSLIST","id":GetUrlKeyValue("ID"),"data":{"CheckedOut":"0"}}); if(res.success){ // success }else{ //error } } });
Custom CSS:
.dffs_checkInOnSave{ display: none; }
I hope this helps. Maybe there is a better solution for this..
Regards,
Michael-
This reply was modified 7 years ago by
Michael.
-
This reply was modified 7 years ago by
-
August 23, 2017 at 23:35 #17913
Sorry for the late reply.
#1:
This can be done with CSS only. Add this to your forms Custom CSS:.dffs_checkInOnSave input{ display:none; }
I’ll fix it in the next version so that clearing the label will hide the checkbox.
#2:
It’s hard to catch the “beforeunload” in a consistent way cross browser and in both dialogs and in normal pages. I’ll try to fix this in the next version, but in the meantime you can test this in the Custom JS in your EditForm:// Hide cancel button in ribbon jQspjs("#Ribbon\\.ListForm\\.Edit\\.Commit\\.Cancel-Large").hide(); if(isDlg){ // Hide close dlg button jQspjs(window.parent.document).find(".ms-dlgCloseBtn").remove(); } jQspjs("input[id$=diidIOGoBack]").click(function(){ toggleCheckOut("0"); if(isDlg){ window.frameElement.cancelPopUp(); }else{ var rUrl = jQspjs("input[id$=diidIOGoBack]:first").attr("onclick").match(/\(\'([^)]+)\'\)/)[1].split("\\u002f").join("/"); STSNavigate(rUrl); } }); function = toggleCheckOut:(a){ var res = spjs.utility.updateItem({"listName":_spPageContextInfo.pageListId,"id":spjs.dffs.data.thisItemID,"data":{"CheckedOut":a}}); if(res.success){ location.href = location.href; }else{ alert(res.errorText); spjs.dffs.chkOut.toDispForm(); } };
Please note that this is tested in SP 2013 / SPO only – not in SP 2010.
Alexander
-
September 7, 2017 at 12:54 #18056
Hi Alexander!
Thanks for the input.
The CSS worked perfectly (of cause), thanksAs for the #2 script: I get an load error and am unable to debug since it won’t even load with the F12 debugging console present. The problem seems to be the “jQspjs” function.
Does it have to beloaded separately? Is it not included in my version? Or is this another problem with the template, which is a calendar.Thanks
Best regards,
Nicole
-
-
September 7, 2017 at 16:42 #18060
My bad – the jQspjs namespace is used only in later versions – just change it to jQuery.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.