我正致力于在 extJS 中制作一个容器,它将根据用户在我的表单中单击另一个网格上的行来动态添加属性网格。我想要这个包含属性的容器 网格可滚动,以便容器保持固定大小,但用户可以根据需要在其中添加或删除任意数量的属性网格。
这是我用来创建容器的代码片段:
Ext.define('SSAF.plugin.CHEF.view.chefAttributeGridContainer', {
extend: 'Ext.container.Container',
autoScroll: true,
layout: {
type: 'vbox'
},
width: 400,
border: 1,
style: {borderColor:'#000000', borderStyle:'solid', borderWidth:'1px'},
defaults: {
labelWidth: 80,
// implicitly create Container by specifying xtype
xtype: 'datefield',
flex: 1,
style: {
padding: '10px'
}
},
items: [
Ext.create('SSAF.plugin.CHEF.view.chefRunListAttributesGrid'),
Ext.create('SSAF.plugin.CHEF.view.chefRunListAttributesGrid'),
Ext.create('SSAF.plugin.CHEF.view.chefRunListAttributesGrid'),
Ext.create('SSAF.plugin.CHEF.view.chefRunListAttributesGrid'),
Ext.create('SSAF.plugin.CHEF.view.chefRunListAttributesGrid')
]
});
虽然我已将 autoScroll 属性添加到我的网格,但我没有收到预期的效果。
这是它目前的样子:
我希望它像布局中的所有其他组件一样保持固定大小:
关于为了实现我想要的效果我可能缺少什么?
谢谢
最佳答案
我能够通过这篇文章提供的解决方案解决我的问题:
关于javascript - 可滚动属性网格容器 - extJS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40285891/