0

I'm having a problem with drag drop on a document library. The document library has a WebPart view filter to show only the document from a selected task WebPart. This works because the document library has a lookup column to the task title.

If one normally uploads a document by +Add document link all is ok. People get shown a form and fill in the lookup task column.

However when people drag a file onto the document library. The webpart link of the selected task is ignored. And documents are uploaded without a task assigned.

How to make it so that the info provided by the selected task from the webpart filter is used?.

1 Answer 1

0

This has been an issue for a long time, multiple file upload has the same problem in that you cannot apply metadata to items when uploading more than one at a time. The work around is to make the desired metadata fields required. This forces the files to remain checked out to the uploader until the required fields are populated and checked in.

You could possibly utilize jQuery UI to hook into the drop event and then look at the page to get the proper ID then use web service updates to do a bulk metadata update of the files. I haven't seen any examples of this in the wild, but it sounds feasible in theory.

Another Approach

You can disable drag and drop functionality. You can do this by adding below scripts in Content Editor Webpart on your view page.

<style type="text/css">
    /*-- Hide Drag & Drop --*/
    caption.ms-dragDropAttract {
        caption-side: bottom;
        display: none !important;
    }
</style>
<script type="text/javascript">
    /*-- Stop Drag & Drop --*/
    ExecuteOrDelayUntilScriptLoaded(function () {
        g_uploadType = DragDropMode.NOTSUPPORTED;
        SPDragDropManager.DragDropMode = DragDropMode.NOTSUPPORTED;
        SPDragDropManager.DargDropMode.style.display = "none";
    }, "DragDrop.js");
</script>
1
  • They want drag and drop disabling it is not an option for me. What i need is that the task webpart as a filter source that the filter is used to fill in the missing metta data, ea if i filter on "task23" then documents dropped on the doc library should in their task lookup column, have filled in "task 23"
    – Peter
    May 11, 2016 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.