Hello,
I'm a bit confused about how to determine the total count of all nodes.
Using kendo with angular it seems if I remove a parent node the total() takes the childs into account after the remove-action.
Its simple reproducable by inserting a simple statement in Teleriks angular-example on http://kendo-labs.github.io/angular-kendo/#/TreeView
Please insert the markup within the h3-tags where you want inside the ng-controller: <h3>{{treeData.total()}}</h3>
<div class="sidepane" ng-show="selectedItem">
Selected: {{selectedItem.text}}
<br /><br />
<button class="k-button" ng-click="addAfter(selectedItem)">Add after</button>
<button class="k-button" ng-click="addBelow(selectedItem)">Add below</button>
<button class="k-button" ng-click="remove(selectedItem)">Delete</button>
<h3>{{treeData.total()}}</h3>
</div>
take this action:
- run code/markup
- select node 'item 3'
- first unexprected behaviour: displayed total() takes childs NOT into account (number is 3 instead 5)
- click button 'Add below' (e. g. 5 times)
- click delete and remove all parents (dont delete the childs explicit)
- result: the displayed total() is > 0 (e. g. 5 if clicked 3 times on 'Add below')
So here my question: how to determine the true number of currently existing nodes? Perhaps its obvious for somebody. For me its not - im fightig to the same time with angular and with kendo, because both is new to me.
Thanks a lot.
I'm a bit confused about how to determine the total count of all nodes.
Using kendo with angular it seems if I remove a parent node the total() takes the childs into account after the remove-action.
Its simple reproducable by inserting a simple statement in Teleriks angular-example on http://kendo-labs.github.io/angular-kendo/#/TreeView
Please insert the markup within the h3-tags where you want inside the ng-controller: <h3>{{treeData.total()}}</h3>
<div class="sidepane" ng-show="selectedItem">
Selected: {{selectedItem.text}}
<br /><br />
<button class="k-button" ng-click="addAfter(selectedItem)">Add after</button>
<button class="k-button" ng-click="addBelow(selectedItem)">Add below</button>
<button class="k-button" ng-click="remove(selectedItem)">Delete</button>
<h3>{{treeData.total()}}</h3>
</div>
take this action:
- run code/markup
- select node 'item 3'
- first unexprected behaviour: displayed total() takes childs NOT into account (number is 3 instead 5)
- click button 'Add below' (e. g. 5 times)
- click delete and remove all parents (dont delete the childs explicit)
- result: the displayed total() is > 0 (e. g. 5 if clicked 3 times on 'Add below')
So here my question: how to determine the true number of currently existing nodes? Perhaps its obvious for somebody. For me its not - im fightig to the same time with angular and with kendo, because both is new to me.
Thanks a lot.