Extjs ComboBox在网格内
我有一个带有一些数据的网格(用户列表)。对于每一行,我有许多操作,例如更新,删除,激活,暂停,查看您为其命名的订单。
我没有放置那么多可以填充超过
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'
})
}
]
});
没有找到相关结果
已邀请:
2 个回复
嘘崇蔡对
邵酮
遗憾的是,我无法确定您的代码在做什么而且无法正常工作。 您使用的是什么版本的ExtJS?有一点值得注意的是,我发现在当前的ExtJS API文档中我没有看到任何名为Ext.data.SimpleStore的对象。您是否尝试过使用其他类型的数据存储?您可能想尝试为此组合使用不同类型的商店?