【发布时间】:2011-05-31 03:19:16
【问题描述】:
我有一个包含一些数据的网格(用户列表)。对于每一行,我都有许多操作,例如更新、删除、激活、暂停、查看您命名的订单。
我不想放置这么多将填充超过400-500 像素的按钮,而是要放置一个组合框,并将一个应用于每个字段的操作。
问题是我不能像那样简单地在列行中呈现组合框,或者我遗漏了什么?有人可以解释一下吗?
new Ext.grid.GridPanel({
region: 'center',
id: 'usersGrid',
store: store,
stripeRows: true,
autoExpandColumn: 'username',
columns: [{
// username
},{
// email
},{
// last seen
},{
// actions combo, it won't show
header: '',
width: 220,
fixed: true,
hideable: false,
dataIndex: 'actions',
renderer: new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({
id: 0,
fields: ['abbr', 'action'],
data: [
['suspend', 'Suspend'],
['activate', 'Activate'],
['update', 'Update'],
['delete', 'Delete']
]
}),
displayField: 'action',
valueField: 'abbr',
mode: 'local',
typeAhead: false,
triggerAction: 'all',
lazyRender: true,
emptyText: 'Select action'
})
}
]
});
【问题讨论】: