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

Dynamic @Url.Content Value

1 Answer 844 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Joel asked on 25 Mar 2019, 07:18 PM

Can you help me understand this #: EmployeeId # syntax?  It seems that is a dynamic value fed in using binding in the TreeList.  But, it doesn't seem to work for me:

Your example from demos:

<script id="photo-template" type="text/x-kendo-template">
   <div class='employee-photo'
        style='background-image: url(@Url.Content("~/shared/web/treelist/people/#: EmployeeId #.jpg"));'></div>
   <div class='employee-name'>#: FirstName #</div>
</script>

 

My instance that doesn't work:

<script id="icon-template" type="text/x-kendo-template">
    <div class='group-icon'
         style='background-image: url(@Url.Content("~/images/32/#: CurrentType.Name #.png"));'></div>
    <div class='group-name'>#: Name #</div>
</script>

 

My treelist is bound to a list of Groups.  On my Group object I have an Object named CurrentType that has a property on it called Name.  I want to base the Icon on the Group.CurrentType.Name.  So, for each group type I have a different Icon.

Thanks, Joel

1 Answer, 1 is accepted

Sort by
0
Joel
Top achievements
Rank 2
Iron
Iron
Iron
answered on 25 Mar 2019, 09:03 PM

Never mind.  I found this explanation:

https://docs.telerik.com/kendo-ui/framework/templates/overview

 

Tags
TreeList
Asked by
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or