data-uid missing on 1/2 of items

4 posts, 1 answers
  1. Chris
    Chris avatar
    23 posts
    Member since:
    Nov 2003

    Posted 05 Apr Link to this post

    Hello

    We have a Listview that populates with an IEnumerable<object>  The data source is set and the read called when a Kendo DropdownList.Change Event is called.

    We have found that the first 1/2 the records with generate elements with data-uid, role="option" & aria-selected="false", while the latter 1/2 do not.  There is no difference in the records, if we add a single record to the list at a time, it will produce the same result, the first 1/2 with, the second 1/2 without.

     

    we are using an external template (pls see below):

    <script type="text/x-kendo-tmpl" id="availableAccessRightsTemplate">
    <div style="padding: 8px 0 8px 10px;letter-spacing:.2px;">
    <span data-toggle="tooltip" title="#= Description#">    #= DisplayName#   </span>
    </div>
    <hr style="margin-top: 0;margin-bottom: 0;" />
    </script>

     

    We see this behavior on 2 different ListViews, albeit on the same page with the same data types (objects).

     

    Thanks for your help in advance

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 07 Apr Link to this post

    Hello Chris,

     

    The issue lays in the template definition. The whole template must be wrapped in a single element, for example:

     

    <script type="text/x-kendo-tmpl" id="template">

    <div>

    ...the rest of the template content goes inside this div...

    </div>

    </script>

     

    This is required as the ListView threats all its direct children an items.

     

    Regards,
    Nikolay Rusev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Chris
    Chris avatar
    23 posts
    Member since:
    Nov 2003

    Posted 07 Apr in reply to Nikolay Rusev Link to this post

    Hello Nikolay

    Thanks for your reply, but I am failing to see the difference between your sample and our template definition.  We did move the hr into the inner div.  From there, the only difference is the id name of the template and some padding on the inner div.

     

    Again, it is 1/2 the items that render that are missing the data-uid, role="option" & aria-selected="false".  So, the template generated 1/2 the items correctly, and 1/2 the items incorrectly.  If we add 4 more records to the list, the generated items remain split 50/50 correctly rendered / incorrectly rendered.

    If I am missing something in your sample, please call it our specifically.

     

    Thanks

  5. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 11 Apr Link to this post

    Hello Chris,

     

    What I mean by wrap the whole template is demonstrated bellow:

    <script type="text/x-kendo-tmpl" id="availableAccessRightsTemplate">
     <div>
      <div style="padding: 8px 0 8px 10px;letter-spacing:.2px;">
       <span data-toggle="tooltip" title="#= Description#">    #= DisplayName#   </span> 
      </div>
      <hr style="margin-top: 0;margin-bottom: 0;" />
     </div>
    </script>

     

    If you update the template as the one above all items should have data-uid rendered.

     

    Regards,
    Nikolay Rusev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready