12 Answers, 1 is accepted
We should really make this into an option, but for the moment you can disable the D&D support using:
kendo.ui.Upload.fn._supportsDrop = function() { return false; }
This script should be executed immediately after including the Kendo UI scripts and before instantiating an Upload.
I hope this helps.
Tsvetomir Tsonev
the Telerik team
$(
"#uploaderID"
).kendoUpload({
async: { ... },
multiple:
false
,
showFileList:
false
,
select:
function
(e) { ... },
upload:
function
() { ... },
complete:
function
() { ... },
error:
function
(ex) { ... }
});
I've prepared a small sample with the latest version on jsBin: http://jsbin.com/itidis/2/edit
Please verify that the script block is executed before instantiating the Upload.
Tsvetomir Tsonev
the Telerik team
Thanks
Pablo
The approach is working correctly on my side, when the widget is initialized via Angular directive. Here is a small example that demonstrates it.
Regards,
Dimiter Madjarov
Telerik
I know this is a pretty old thread but is there a cleaner way to do this now?
All I want is the button, no dropzone, no file list and no "done" text in the drop zone after an upload.
I used this hack to remove the dropzone and .ShowFileList(false) to remove the file list. Unfortunately as soon as i successfully upload a file the dropzone reappears with the text "Done". I have tried calling kendo.ui.Upload.fn._supportsDrop = function() { return false; }
again in the complete event but it doesn't disappear.
Thanks,
Matt
Hello Matt,
This behavior is not supported by the Upload widget out of the box. The upload status message and the gray wrapper will be re-displayed after each file upload.
Regards,Dimiter Madjarov
Telerik
Never mind I was able to do it by playing with the CSS, would still like to know if there is a better way though.
Hello Kjell,
As stated previously the behavior is not supported out of the box, so indeed custom CSS modifications will be required to make it work.
Regards,Dimiter Madjarov
Telerik
I have two upload controls on my page and I want to disable the drop zone on only one of them.
The problem with using your javascript line is it disables it on both.
How do I disable it on only one?
Hello Robert,
This could be achieved by overriding the _supportsDrop function twice before the initialization of each Upload widget. Here is an example, that demonstrates the approach. Keep in mind that this will lead to small difference in the look of the two widgets (as you can see in the demo), which is expected, because the dropzone adds some additional CSS styles. You could add those manually if the Uploads should look the same.
Regards,Dimiter Madjarov
Telerik