onUpload event doesn't fire

4 posts, 0 answers
  1. Bill
    Bill avatar
    4 posts
    Member since:
    Jun 2016

    Posted 17 Oct Link to this post

    Hi,

    I'm trying to upload multiple files, and for each file I need to pass 2 more values: 'Display Name' and 'Description'. I've added two more input boxes to the template for each file and set the process to async, AutoUpload(false) and Batch(False).

    On the Upload event I want to pass these two values:

    var fileName = .{ get file name};

    e.data = { DisplayName: $("#DisplayName_" + fileName).val(), Description: $("#Description_" + fileName).val() };

    I drag and drop files, enter names and decs for each of them and I press the 'Upload' button, but onUpload event doesn't fie. 

    @(Html.Kendo().Upload()
                              .Name("files")
                              .TemplateId("fileTemplate")
                              .Async(a => a
                                  .Save("SaveFile", "Test")
                                  .AutoUpload(false)
                           .Batch(false))  
                              .Events(events => events
                                  .Upload("onUpload")
                              ))
    function onUpload(e) {
            alert('onUpload');
    }
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 17 Oct Link to this post

    Hello Bill,

    The provided sample code looks correct (as in our events demo), so we cannot state what is the exact reason for the problem. I would recommend to check the developer tools console for JavaScript errors, that may hint what is the reason for the problem. Additionally you could send us small isolated runnable example, so we could inspect it locally and assist further.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
  4. Bill
    Bill avatar
    4 posts
    Member since:
    Jun 2016

    Posted 20 Oct in reply to Dimiter Madjarov Link to this post

    Hi Dimiter.

    I've solved the problem. The small modification of the css caused the upload button to move on click event and it didn't register the full mouse click event, it didn't fire the Upload event. I fixed the css and it works fine now. It was nothing wrong with the component.

    Kind Regards,

    Bill

     

  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 21 Oct Link to this post

    Hello Bill,

    Thank you for the update. I am glad the issue is resolved.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
     
Back to Top
Kendo UI is VS 2017 Ready