Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一棵用 extjs 4.x 制作的树,我需要计算任何节点,即该节点的叶子数。我的意思是叶子的总数,这也意味着该节点的“子节点”的叶子。我看到有一个级联方法,但我无法使用它。
var leafCount = 0; treePanel.getRootNode().cascadeBy(function(node){ if(node.isLeaf()) leafCount++; });