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

Add File on client with Javascript

1 Answer 189 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Robert Madrian asked on 05 Aug 2016, 01:34 PM

Hi,

I use the upload Control in a editor template in my telerik mvc grid - as you can see in the attached Picture. Upload works but I also want to

have an initial file if it is saved in the DB - so that I can use upload remove to delete it - but I have to set the file in the onEdit Event on client of the grid but this does'nt work (see Code)

  • is it not possible to use MVC Upload Control and set a file(s) in Javascript?
function onEdit(e) {
        var files = [
            { name: "file1.doc", size: 525, extension: ".doc" },
            { name: "file2.jpg", size: 600, extension: ".jpg" },
            { name: "file3.xls", size: 720, extension: ".xls" },
        ];
        $("#Vorlagenname1_WordvorlageUpload").kendoUpload({
            files: files
        });
    }

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 08 Aug 2016, 07:28 AM

Hello Robert Madrian,

Setting the initially selected files is only possible when the widget is initialized, as in the current case. If the widget should be initialized in the edit event handler, I would recommend to stick to the JavaScript version of the Upload.

Regards,
Dimiter Madjarov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Upload
Asked by
Robert Madrian
Top achievements
Rank 1
Veteran
Iron
Answers by
Dimiter Madjarov
Telerik team
Share this question
or