【问题标题】:extjs tree panel with sequence numbering带有序列号的 extjs 树面板
【发布时间】:2016-02-18 12:58:24
【问题描述】:

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

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

【问题讨论】:

  • 您可以使用Ext.data.field.Fieldconvert 方法创建一个自定义字段来实现此目的。

标签: extjs


【解决方案1】:

此答案可能仅作为指南,您必须对其进行调整以达到您想要的要求。所以基本上我正在遍历记录并检查节点是否有任何子节点: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
    }
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多