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

onUpload event doesn't fire

3 Answers 677 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 17 Oct 2016, 05:02 AM

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');
}

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 17 Oct 2016, 07:34 AM

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.
 
0
Bill
Top achievements
Rank 1
answered on 21 Oct 2016, 02:05 AM

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

 

0
Dimiter Madjarov
Telerik team
answered on 21 Oct 2016, 07:27 AM

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.
 
Tags
Upload
Asked by
Bill
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Bill
Top achievements
Rank 1
Share this question
or