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

Reset File Upload after successful upload

3 Answers 1009 Views
Upload
This is a migrated thread and some comments may be shown as answers.
anooj
Top achievements
Rank 1
anooj asked on 04 Dec 2014, 06:20 PM
Hi,

I am using Kendo UI file upload along with angular js and asp.net mvc, how can i reset the file upload and the list of file from UI after a successful upload. Since i am using angular i don't want to use $('elemnt id') , is there a event which i can hook up?

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 05 Dec 2014, 12:54 PM
Hello Anooj,


In the current case you could directly use the showFileList configuration option and set it to false. This way the list will not show at all.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
anooj
Top achievements
Rank 1
answered on 05 Dec 2014, 06:25 PM
Unfortunately that does not fit my requirement, i want to show the list of uploaded files to the user, once i click save which is an another event on the page , i need to remove the list from the UI. Right now i am using 

$(".k-upload-files").remove();
                $(".k-upload-status").remove();
                $(".k-upload.k-header").addClass("k-upload-empty");
                $(".k-upload-button").removeClass("k-state-focused");

to do that, but i don't want to access those elements directly in my angular controller and wanted to know if you have any events which i can wire up like k-destroy or something?
0
Dimiter Madjarov
Telerik team
answered on 08 Dec 2014, 12:59 PM
Hello Anooj,


At the moment there is no specific built in functionality to reset the UI of the widget to it's initial state. Accessing and removing the unneeded DOM elements and applying the appropriate classes should be used instead. Another approach would be to directly destroy the widget and initialize it again.

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
anooj
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
anooj
Top achievements
Rank 1
Share this question
or