extjs树面板中的滚动条不起作用 [英] Scrollbar in extjs tree panel does not work

查看:592
本文介绍了extjs树面板中的滚动条不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我的树状面板的滚动条不再工作了。虽然仍然可以移动滚动条,树不再移动了。在Firefox和Chrome中也是这样。

Sometimes it happens that the scrollbar of my tree panel does not work anymore. While it's still possible to move the scrollbar, the tree doesn't move at all anymore. That happens to me in Firefox and in Chrome as well.

这是我的树面板的来源:

Here is the source of my tree panel:

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

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
},
{
文本:'搜索',
处理函数:function(){
name = [];
Ext.Array.each(tree.getView()。getChecked(),function(rec){
names.push(rec.get('text'));
});

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'),
                        }
                    });
                }
    }
    ]
}]

});

推荐答案

我也有同样的问题。他们使用自定义滚动条,它非常漂亮(在chrome中特别)。要删除自定义滚动条,请在config中添加以下内容:

I've had the same problem. They use custom scrollbar and it's pretty buggy (especialy in chrome). To remove custom scroller add the following to the config:

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

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

I haven't tried it for treepanel. But it worked perfectly for the gridpanel (since both tree and grid are just extensions of Ext.panel.Table the solution should work for treepanel too).

这篇关于extjs树面板中的滚动条不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆