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

Allow user to remove files before upload, but not after

1 Answer 123 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 27 Jul 2013, 10:35 PM
I have the following config:
$("#upload-file").kendoUpload({
            async: {
                saveUrl: "http://mysite.com/upload",
                removeUrl: "remove",
                autoUpload: false
            }
        });
I would like to have the remove buttons on all the files before the user uploads the files (so they can remove any that were accidentally selected). I do not want to provide a remove button after the files have been uploaded because we are not currently supporting removal of files after they are uploaded.

I see that removing the "removeUrl" setting removes the ability to remove files all together. Is there a way to configure the control the way I describe?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 29 Jul 2013, 11:23 AM
Hello Joshua,


A sample approach, that could be used to achieve this is to bind to success event and manually remove the button, when files are uploaded.
E.g.
function success(e) {
    if (e.operation == "upload") {
        var that = this;
        setTimeout(function () {
            $(that.wrapper).find("li.k-file-success .k-upload-action")
                           .css("visibility", "hidden");
        });
    }
}

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Josh
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or