0
votes

I'm trying to add some icons inline to the TreeView data items, however the k-template directive does not seem to be rendering anything.

I base this off of the online docs at

         http://demos.telerik.com/kendo-ui/treeview/angular

and here's a plunkr of what I'm trying to do:

treeview plunkr

My HTML (with a simple test)

<div id="treeview" kendo-tree-view="nav.treeview"             
                k-options="nav.treeOptions"
                k-data-source="nav.reportsTreeDataSource"
                k-on-change="nav.onTreeSelect(dataItem)">
    <span k-template>{{dataItem.text}} TEST THIS TEMPLATE !!!</span>        
</div>

and here's a snippet of my dataSource coming from my datacontext service:

function getReportsTree() {
        var reportsJson = [
            {
                id: 1, text: "Standard", expanded: false, spriteCssClass: "rootfolder", checkChildren: true, items: [ 
                            { id: 3, text: "MTM Aggr", reptName: "MTM Aggr", spriteCssClass: "folder" },
                            { id: 4, text: "Member Aggr", reptName: "Member Aggr", spriteCssClass: "folder" }
                        ]
            },
            {
                id: 30, text: "Hierarchy", expanded: false, spriteCssClass: "rootfolder", checkChildren: true, items: [
                            { id: 31, text: "Ctpy Hrchy", reptName: "CTPYHIER", withHierarchy: 'true' },
                            { id: 32, text: "Ctpy/BkgLocation Hrchy", reptName: "CTPYHIER_BKG_LOC", withHierarchy: 'true' }
                ]
            }
        ];
        return $q.when(reportsJson);
    }

Image showing the rendered tree, where the template does NOT render :

treeview

I need to know if I'm missing some key piece here, or do I have incorrect formatting.

thank you in advance,

Bob

**** UPDATE **** I'm now checking to see if my Kendo UI library is a few versions behind. It may have something to do with my issue.

1
I may have an outdated library, specifically for this treeview-with-template feature... - bob.mazzo

1 Answers

1
votes

A Kendo UI lib update to 2014.3.1308 was necessary to get the k-template option embedded into the treeview.

However I do find a minor bug, even on their demo website - when you expand a tree node, that same level's text becomes the literal {{dataItem}}.