3 Answers, 1 is accepted
You can use the treeview templates and get the items count through item.items.length:
#= item.text #
# if (item.items) { #
(#= item.items.length #)
# } #
Alex Gyoshev
the Telerik team
#= item.text #
# if (item.items) { #
(#= item.items.length #)
# } #
Does not return number of items.. It returns (0)
Hello Jose,
I am afraid that this approach has not been relevant for quite some time. You can calculate the children count in the dataBound event, as shown in this Dojo snippet.
Regards,Alex Gyoshev
Telerik
I have created a new dojo sample that illustrates how the functionality can be achieved.
The example uses the dataBound event and checks the number of child nodes for each item. Then the count is shown as a badge element next to the parent title.
https://dojo.telerik.com/zMABgMdh/3
Give the sample a try and let me know how it works for you.