This is a migrated thread and some comments may be shown as answers.

How to increase dropzone for kendo upload widget

1 Answer 155 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Janusz
Top achievements
Rank 1
Janusz asked on 20 Apr 2016, 11:54 AM

By default drag and drop files works excellent for chrome browser if the cursor is exactly over the kendo upload widget. Important - this widget is used in my application not in async mode. But when then cursor is not over kendo upload control the default action is triggered. I've blocked this by the simple code below.

$(document).on("dragover drop", function (e) {
    if (e.target.type != "file") {
        e.stopPropagation();
        e.preventDefault();
    }
});

Instead of blocking I want to change this. so when I drag file over any control in my webpage it will add a file to my kendo upload control. I've found the below solution, but this works only for one file.

$(document).on("dragover drop", function (e) {
    e.stopPropagation();
    e.preventDefault();  // allow dropping and don't navigate to file on drop
}).on("drop", function (e) {
    var dataTransfer = e.originalEvent.dataTransfer;
    $("input[type='file']").prop("files", dataTransfer.files); // put files into element
});

 

Definition of this widget is simple.

<div class="zalaczniki-files">
    @Html.Label("Opis załączników:")
    @Html.TextBox("linkDesc")
    @(Html.Kendo().Upload()
            .Name("files")
            .Multiple(true)
            .Messages(m => m.Select(linkCaption)))
</div>

 

Please - help.

 

Regards

Jaśkowiec Józef

Rekord

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 21 Apr 2016, 07:43 AM

Hello Janusz,

Currently the Upload widget does not support customization of it's DropZone. You could post this suggestion for implementation in our Feedback portal.

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Upload
Asked by
Janusz
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or