Reset File Upload after successful upload

4 posts, 0 answers
  1. anooj
    anooj avatar
    6 posts
    Member since:
    Dec 2014

    Posted 04 Dec 2014 Link to this post

    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?

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 05 Dec 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. anooj
    anooj avatar
    6 posts
    Member since:
    Dec 2014

    Posted 05 Dec 2014 in reply to Dimiter Madjarov Link to this post

    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?
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 08 Dec 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready