Extjs 4中的网格面板滚动条不起作用 [英] Grid Panel Scrollbars in Extjs 4 not working

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

问题描述

var gusersPanel = Ext.create('Ext.grid.Panel', {
    flex:1,
    columns: [{
        header: 'User Login',
        dataIndex: 'user_login',
        width:150
    },{
        header: 'User Name',
        dataIndex: 'user_nicename',
        width:150
    },{
        header:'Privledge',
        dataIndex:'admin',
        width:150
    }],
    autoScroll: true,
    layout:'fit',
    selModel: gusersSel,
    store: gusersStore

})

我正在Extjs4.0.2a中的网格面板上使用以上代码,当我在商店中动态填充数据时,滚动条不起作用. 我也尝试对网格面板使用doLayout(),但也可以使用. 网格面板位于窗口中.

Hi I am using above code for the grid Panel in Extjs4.0.2a When I populate data dynamically in the store the scrollbars are not working . I have also tried using doLayout() for grid Panel but dosent work too . The grid Panel is in a Window .

有什么可以解决这个问题的吗?

Anything that can solve this problem ?

实际上,它可以工作一段时间,但并不能一直工作.

Actually it works for some time but dosen't work all the time .

推荐答案

我遇到了同样的问题.他们使用自定义滚动条,这是相当大的错误(尤其是在chrome中).如果您不打算使用无限滚动,则可能的解决方案是删除自定义滚动条并使用本机滚动条.为此,只需将以下内容添加到网格的配置中即可:

I've had the same problem. They use custom scrollbar and it's pretty buggy (especialy in chrome). If you are not going to use infinite scroll the possible solution could be to remove custom scrollbar and use native one. To do that just add the following to the grid's config:

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

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

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