【问题标题】:ext.js hide certain cells based on row and cell indexesext.js 根据行和单元格索引隐藏某些单元格
【发布时间】:2015-03-25 14:30:40
【问题描述】:
  • 存储为 Ext.data.TreeStore,网格为 Ext.tree.Panel。我们之前从后端构建了一棵树并将其传递给 treeStore。因此,当我按列扩展行时,该列值不会显示在其子节点中。
  • 现在我使用lazyfill 加载一个节点的数据一次,我想隐藏其父级扩展的那些列文本。如果我设法获取单元格的行和列索引,我该怎么做?
  • 以下代码在treeStore的监听器中:

    load: function(treestore, node, records, successful, eOpts) {
         //get the column and row indexes of a node
    },
    datachanged: function(view, eOpts){
         //??select the cell with column and row indexes and hide it.
    } 
    

提前致谢。

【问题讨论】:

    标签: javascript lazy-loading extjs4.2


    【解决方案1】:

    这是不可能的,因为返回的数据中没有extjs生成的列索引信息。因此,在只有纯数据的 load 或 datachanged 函数中,无法隐藏某些列。

    解决方案是从后端删除这些数据并将您单击的节点的父节点传递给后端进行处理。所以你仍然在构建一棵树,但一次只有一个节点。

    【讨论】:

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