gpt4 book ai didi

extjs 网格面板不显示滚动条

转载 作者:行者123 更新时间:2023-12-04 23:07:15 24 4
gpt4 key购买 nike

我正在创建一个仅包含网格面板的页面,我希望我的网格面板具有基于浏览器大小的滚动条。为此,我将其包装在视口(viewport)中,如 here 所述并确保我指定了所讨论的布局here .网格渲染得很好,但我没有得到任何滚动条。我已经尝试过“fit”、“border”和“anchor”布局,但仍然没有运气。代码如下所示:

Ext.create('Ext.Viewport', {
items: [{
region: 'center',
layout: 'fit',
xtype: 'gridpanel',
store: myStore,
loadMask: true,
columns: [{
header: 'Account ID',
dataIndex: 'acct_id',
width: 70
}, {
header: 'First Name',
dataIndex: 'first_name',
width: 120
}, {
header: 'Last Name',
dataIndex: 'last_name',
width: 120
}, {
xtype: 'numbercolumn',
header: 'Account Balance',
dataIndex: 'acct_bal',
width: 70,
renderer: Ext.util.Format.usMoney
}, {
xtype: 'numbercolumn',
header: 'Credit',
dataIndex: 'credit',
width: 70,
renderer: Ext.util.Format.usMoney
}, {
xtype: 'numbercolumn',
header: 'Debt',
dataIndex: 'debt_bal',
width: 70,
renderer: Ext.util.Format.usMoney
}],
}]
});

最佳答案

你应该设置fit布局到 Viewport :

Ext.create('Ext.Viewport', {
layout: 'fit',
items: [...]
});

GridPanel 中设置布局没有效果。

关于extjs 网格面板不显示滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9023681/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com