jquerykendo-uikendo-upload

Kendo v2014.3.1119 - Upload - getFiles is not a function


I'm using Kendo UI v2014.3.1119

I could instantiate a kendo element:

$("#files").kendoUpload({
    async: {
        autoUpload: false
    }
    , multiple: false
});

However, when bind to a button event:

$('#uploadBtn').on('click', function (e) {
        e.preventDefault();

        var hey = $('#files').data('kendoUpload');

        console.log(hey.getFiles())
    });

I got the following error:

Uncaught TypeError: hey.getFiles is not a function

I followed the example from here

Not sure if this is a version issue or something I did incorrectly? Please help !

Thanks


Solution

  • getFiles() method, to retrieve selected files, was only implemented much later (in Kendo UI R3 2016)

    I would suggest you to update your kendo version. If you can't for some reason you can extend the kendoUpload component and implement for your. An approach to extend a component is described here.

    André