2

有时会发生我的树面板的滚动条不再起作用。虽然仍然可以移动滚动条,但树根本不再移动。这在 Firefox 和 Chrome 中也发生在我身上。

这是我的树面板的来源:

var treeStore = Ext.create('Ext.data.TreeStore', { proxy: { type: 'ajax', url: '../tree.pl' } });

var tree = Ext.create('Ext.tree.Panel', { store: treeStore, renderTo: 'tree', title: 'Tree', width: 400, height: 450, rootVisible:false, dockedItems: [{ xtype: 'toolbar', dock: 'bottom', items: [ { xtype: 'tbspacer', width: 340 }, { text: 'Search', handler: function(){ names = []; Ext.Array.each(tree.getView().getChecked(), function(rec){ names.push(rec.get('text')); });

                    resultStore.load({
                        params:{
                            search_type: 'tree',
                            tree_nodes: names.join('II'),
                        }
                    });
                }
    }
    ]
}]

});

4

4 回答 4

8

我有同样的问题。他们使用自定义滚动条,而且非常有问题(特别是在 chrome 中)。要删除自定义滚动条,请将以下内容添加到配置中:

var tree = Ext.create('Ext.tree.Panel', {
  scroll          : false,
  viewConfig      : {
    style           : { overflow: 'auto', overflowX: 'hidden' }
  },
  // ...
});

我还没有为treepanel尝试过。但它对于网格面板非常有效(因为树和网格都只是 Ext.panel.Table 的扩展,因此该解决方案也适用于树面板)。

于 2011-11-07T12:36:42.807 回答
4

在 Ext 4.1 中,自定义滚动条将再次被原生滚动条取代。虚拟化滚动条旨在支持无限滚动、列锁定等,但我相信在 4.1 中他们已经设法解决了这些问题并且仍然保留了原生滚动条。如果 4.0.x 中的当前问题因此得到解决,我会感到惊讶。

于 2011-11-07T17:24:26.837 回答
0

在 EXT 4.0 中,位于主库资源下的 ext-all.css 文件中,这是它不起作用的真正原因。这个 css 文件的编码器决定网格单元应该有overflow: hidden;(大约 3324 行):

.x-grid-cell {
    overflow: hidden;
    font: normal 13px tahoma, arial, verdana, sans-serif;
    user-select: none;
    -o-user-select: none;
    -ms-user-select: none;
    -moz-user-select: -moz-none;
    -webkit-user-select: none;
    cursor: default
}

.x-grid-cell-inner {
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    padding: 3px 6px;
    white-space: nowrap
}

最好的办法是将溢出设置为继承两个类,这个问题神奇地消失了。

唯一剩下的是网格表的边框,但这可以通过在你的 css 中放置 css 样式来处理。我建议不要将它放在 ext-all.css 文件中。

.x-grid-table {
    border: none !important;
    width: auto !important;     
}

请记住,这将改变任何使用.x-grid-cell.

于 2012-02-22T20:12:49.837 回答
0

我正在使用分机 4.0.7。

滚动:真

为我工作。但是,由于某种原因,有人补充说:

布局:锚点

到树面板的配置,这导致它停止工作。如果您发现这scroll: true不起作用,请尝试查看是否有人添加了布局并将其删除。

希望有帮助。

于 2012-04-18T16:38:36.560 回答