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

Conditional Custom Image

1 Answer 45 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
x
Top achievements
Rank 1
x asked on 02 Feb 2015, 03:51 PM
Hello,

In my treeview how do I display a different custom image if hasChildren is true.

Thanks,
Rich

$("#clientsTree").kendoTreeView({
           dataTextField: "nodeName",
           dragAndDrop: true,
           dataSource: {
               transport: {
                   read: {
                       url: "@Url.Action(MVC.UnityClientProfileManager.ClientProfile.GetAllParentClients())",
                   }
               },
               schema: {
                   model: {
                       id: "nodeId",
                       hasChildren: "hasChildren",
                       fields: {
                           //nodeId: { type: "string" },
                           nodeParentId: { type: "string" },
                           nodeName: { type: "string" },
                           clientId: { type: "number", nullable: true },
                           clientGuid: { type: "string", nullable: true },
                       }
                   }
               }
           },

{
   "nodeId": "/52/",
   "nodeParentId": "/",
   "nodeName": "Preferred Materials, Inc",
   "nodeLevel": 1,
   "hasChildren": false,
   "expanded": false,
   "clientId": 52,
   "clientGuid": "1f3c21db-319b-e311-9b61-00155de1f901"
 },
 {
   "nodeId": "/78/",
   "nodeParentId": "/",
   "nodeName": "Rich Group",
   "nodeLevel": 1,
   "hasChildren": true,
   "expanded": false,
   "clientId": 78,
   "clientGuid": "46fe584c-3165-e411-953e-00155de1f901"
 }

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 03 Feb 2015, 04:22 PM

Hello Rich,

You can achieve this via the template configuration option, with conditionals in the template. See this Dojo snippet for a functional example.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
x
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or