1

Please, let me know in what way we can programmatically know if node in kendo treeview structure has childrens ?

Need to apply corresponding class for nodes which has children...

Thank you !

user2542456
  • 81
  • 2
  • 11

1 Answers1

0

Look at this demo. They use ngClass in the node template to set the icon displayed on the node.

You can also check if a node has children by using the hasChildren(item) method of the TreeView.

Shai
  • 3,659
  • 2
  • 13
  • 26
  • 1) They use ngClass inside of ng-template to define what kind of icon to show. In my case I need to apply class for element
  • (from devTools) which is node.For that moment I don't imagine how it may be done using kendo's api.
  • – user2542456 Jan 29 '18 at 21:22
  • 2) they use such input parameters for inner logic of component as I it imagine: [hasChildren]="hasChildren" <-- use fetchChildren function to check if node has children. My goal is to set special class or attribute for node(li.k-item) which has children. For that time it's a secret for me how it may be implemented using standard kendo's api. – user2542456 Jan 29 '18 at 21:32
  • Why do you need to apply a class specifically on the `li` itself? – Shai Jan 30 '18 at 08:09
  • Because I need to customize kendo's treeview for compliance to required design and for that purposes I need to apply for items (`li`) special class if they have children. – user2542456 Jan 30 '18 at 09:40
  • You don't have to apply the class directly to the `li` elements, you can do it the way they did it in the demo. Why add the class directly to the `li`? – Shai Feb 01 '18 at 08:07