This is a migrated thread and some comments may be shown as answers.
data-uid missing on 1/2 of items
3 Answers 24 Views
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 2
Chris asked on 05 Apr 2016, 10:15 PM

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

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 07 Apr 2016, 08:37 AM

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
0
Chris
Top achievements
Rank 2
answered on 07 Apr 2016, 03:40 PM

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

0
Accepted
Nikolay Rusev
Telerik team
answered on 11 Apr 2016, 07:18 AM

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
Asked by
Chris
Top achievements
Rank 2
Answers by
Nikolay Rusev
Telerik team
Chris
Top achievements
Rank 2
Share this question
or