Unique Name Generation

1 Answer 146 Views
TaskBoard
Scott
Top achievements
Rank 1
Scott asked on 22 Jun 2021, 05:53 PM

Hello,

How do you generate a unique name for a control that is part of a template? I have a DropDownList in my template for a TaskBoard but only the first instance works since the name of each is the same I assume. The browser warns me too that that is the case. Appreciate any help.

 

-Scott

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 25 Jun 2021, 10:14 AM

Hi, Scott,

In general, when the templates of the taskboard are built, the data item associated with the respective template is passed. Hence, you have access to the field values of the data item. The recommended approach is to decorate the names of the inner widgets in such a way that they feature the ID of the data item. This way, you know 100% that the names are unique as for the different templates you will have different IDs. 

You could access the field as shown below. You could concatenate it with the name of the DropDownList so that it procudes a unique name:

 <script id="column-template" type="text/x-kendo-template">
                    <h3>#: MyIdField #</h3>
        </script>

Let me know if further assistance is needed.

 

Best regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Scott
Top achievements
Rank 1
commented on 25 Jun 2021, 02:09 PM

That worked perfectly, thank you so much!

Regards - Scott
Tags
TaskBoard
Asked by
Scott
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or