具有序列编号的extjs树面板

时间:2016-02-18 12:58:25

标签: extjs

要求:我的树面板项/元素应具有编号系统

1. Master Pack
 1.1. Acceptance
      1.1.1. Client
      1.1.2. Mission
1.2. Planning
       1.2.1. Fieldwork 1
       1.2.2. Fieldwork 2
1.3. Completion
       1.3.1. End of Audit Memo

1 个答案:

答案 0 :(得分:0)

这个答案可能只是作为指导服务器,你必须调整它以达到你想要的要求。所以基本上我循环记录并检查节点是否有孩子:parent基本上是你的记录。

Ext.each(parent, function(node) {
    if (node.children !== null && node.children.length !== 0) {
        // Number the current node         
        this.numberMyNodes(node.children);        //Call itself if to number the children.
    } else {
        //this node has no children
    }
});
相关问题