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

Multiple files not showing properly

3 Answers 221 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Drew Auman
Top achievements
Rank 1
Drew Auman asked on 10 Dec 2013, 03:11 PM
Hi,

I am following the template demo for the Upload widget with the latest version of Kendo UI.  But when I select multiple files in the file explorer, all that shows is a single file in the <ul class="k-upload-files">.  Again, only a single <LI> is showing in that list, even when I select multiple files.  I debugged through the Kendo Upload javascript and see that it is not creating multiple <LI>'s.  Can anyone explain the reason for this because it is very frustrating.

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 10 Dec 2013, 03:58 PM
Hi Drew,

Are you using the synchronous version of the Upload widget? If that is the case, then it is expected for the selected files to be rendered under a single list item as this is the default behavior of the widget. This could also be observed in the basic usage demo. Nevertheless in the templates data there is a files array which contains the individual information about each of the selected files. You could use it in the template, iterate over it and specify a custom visualization.

Please let me know if this information helps.

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tim
Top achievements
Rank 1
answered on 03 Jul 2016, 06:06 PM

Hi, do you have an example of how to list the files using the synchronous version and a template? Should I use the onSelect event or modify the template?

Thanks.

<script id="fileTemplate" type="text/x-kendo-template">
    <span class='k-progress'></span>
    <div class='file-wrapper'>
        <span class='file-icon #=addExtensionClass(files[0].extension)#'></span>
        <h4 class='file-heading file-name-heading'>Name: #=name#</h4>
        <h4 class='file-heading file-size-heading'>Size: #=size# bytes</h4>
        <button type='button' class='k-upload-action'></button>
    </div>
</script>

 

0
Dimiter Madjarov
Telerik team
answered on 04 Jul 2016, 06:35 AM

Hello Tim,

You could utilize the files array parameter, which is passed to the template and iterate it in the template itself to list the files. Additional information regarding the Kendo UI template syntax could be found on the following documentation page.

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