gpt4 book ai didi

extjs - 向网格添加工具栏 - Extjs

转载 作者:行者123 更新时间:2023-12-03 18:16:03 25 4
gpt4 key购买 nike

我这里有以下网格:

Ext.define('AM.view.user.List', {
extend: 'Ext.grid.Panel',
alias: 'widget.userlist',
title: 'All Users',
store: 'Users',

initComponent: function () {
this.columns = [{
header: 'Name',
dataIndex: 'name',
flex: 4
}, {
header: 'User ID',
dataIndex: 'user_id',
flex: 1
}, {
header: 'Address',
dataIndex: 'address',
flex: 3
}, {
header: 'Age',
dataIndex: 'agee',
flex: 5
}];

this.callParent(arguments);
}
});

工具栏可以添加到此网格的底部还是只能添加到面板?

另外,如何将普通文本放置在工具栏而不是按钮中?

最佳答案

是的,网格面板继承了 Ext.grid.Panel ,您应该能够添加:

dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'button',
text: 'Left Button'
}, {
xtype: 'tbfill'
}, {
xtype: 'button',
text: 'Right Button'
}]
}]

关于extjs - 向网格添加工具栏 - Extjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17861352/

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