Conditional Custom Image

2 posts, 0 answers
  1. Rich
    Rich avatar
    9 posts
    Member since:
    Jul 2014

    Posted 02 Feb 2015 Link to this post

    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"
     }
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 03 Feb 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top