dimanche 1 mars 2015

Tree Panel markup other than visible

Hello,

I'm using Tree Panel component and I'm doing a filtration using my customize filterFn function.


However, I've didn't found any method, which allows me to count tree leaves after tree filtration.


Since a filtered node is marked with positive "visible" attribute, but is really visible when tree is shown (expanded), it`s attribute is visible most of time,


How can I run a function, which count all filtered (for both shown and not-shown) nodes?


I'm attaching 2 codes block here:


1. Count all leaves (ignores filtration)


var filtered_leaves = 0;

store.getRootNode().cascadeBy(function(node) {

if (node.isLeaf()) {

filtered_leaves++;

}

});


2. Count all leaves (count only leaves when those are visible and shown on screen. (expanded and filtered)


var filtered_leaves = 0;

store.getRootNode().cascadeBy(function(node) {

if (node.isLeaf()) {

if (node.isVisible()) {

filtered_leaves++;

}

}

});


3. Count all leaves that are visible if tree will be expanded (no matter whether these display on screen or not)


????






Tree Panel markup other than visible

Aucun commentaire:

Enregistrer un commentaire