PDA

View Full Version : TreeStore get deepest child level



Misiu
17 Dec 2013, 11:48 AM
I have TreeStore and I would like to know what is it level of deepest child.
I've build simple example here: http://jsfiddle.net/VbTjx/41/

47255
(http://jsfiddle.net/VbTjx/41/)for treestore specified in my example I would like to get 5.
I'm wondering if there is any build in function?
Any advises are welcome :)

Misiu
17 Dec 2013, 12:04 PM
I got it:


var lvl = 0;
store.getRootNode().cascadeBy(function (n) {
var p = n.getDepth();
if (p > lvl) lvl = p;
});
console.log(lvl);

Hope someone will find it useful.