使用 ExtJs 进行多选组合框
如何使用 ExtJs 实现多选组合框作为 Ext.FormPanel
的一部分?我一直在寻找,但似乎找不到与最新版本的 ExtJs 兼容的解决方案(这个问题类似,但没有工作/当前的解决方案)。
这是我到目前为止所拥有的,但它是一个单一的选择:
new Ext.FormPanel({
labelAlign: 'top',
frame: true,
width: 800,
items: [{
layout: 'column',
items:[{
columnWidth: 1,
layout: 'form',
items: [{
xtype: 'combo',
fieldLabel: 'Countries',
name: 'c[]',
anchor: '95%',
allowBlank: false,
typeAhead: true,
triggerAction: 'all',
lazyRender: true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: ['myId', 'displayText'],
data: [
["CA", 'Canada'],
["US", 'United States'],
["JP", 'Japan'],
]
}),
valueField: 'myId',
displayField: 'displayText'
}]
}]
}]
}).render(document.body);
How do you implement a multiselect combobox as part of a Ext.FormPanel
using ExtJs? I've been looking, but can't seem to find a solution that is compatible with the latest version of ExtJs (this question is similar, but doesn't have a working/current solution).
This is what I have so far, but it's a single select:
new Ext.FormPanel({
labelAlign: 'top',
frame: true,
width: 800,
items: [{
layout: 'column',
items:[{
columnWidth: 1,
layout: 'form',
items: [{
xtype: 'combo',
fieldLabel: 'Countries',
name: 'c[]',
anchor: '95%',
allowBlank: false,
typeAhead: true,
triggerAction: 'all',
lazyRender: true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: ['myId', 'displayText'],
data: [
["CA", 'Canada'],
["US", 'United States'],
["JP", 'Japan'],
]
}),
valueField: 'myId',
displayField: 'displayText'
}]
}]
}]
}).render(document.body);
I didn't see any parameters in the documentation that suggests that this is supported. I also found this and this but I could only get them working with Ext 2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 SuperBoxSelect 扩展。
Check out the SuperBoxSelect extension.
查看 Saki 的 Ext.ux.form.LovCombo
Check out Saki's Ext.ux.form.LovCombo