Multiple files not showing properly

4 posts, 1 answers
  1. Drew Auman
    Drew Auman avatar
    17 posts
    Member since:
    Sep 2009

    Posted 10 Dec 2013 Link to this post

    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
  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 10 Dec 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Tim
    Tim avatar
    12 posts
    Member since:
    Nov 2012

    Posted 03 Jul in reply to Dimiter Madjarov Link to this post

    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>

     

  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 04 Jul Link to this post

    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.
     
Back to Top
Kendo UI is VS 2017 Ready