【发布时间】:2012-09-06 11:25:44
【问题描述】:
我有一些按列描述的代码
cols.offer.push({
dataIndex: 'tags',
header : 'Тэги',
width:150,
editor : {
xtype : 'combo',
store : gridTagStore,
queryMode: 'local',
displayField: 'name',
//valueField: 'name',
multiSelect:true,
typeAhead: true,
editable:false,
triggerAction: 'all',
selectOnTab: true,
lazyRender: true,
listClass: 'x-combo-list-small',
listeners: {
focus: function(e) {
this.setValue(this.rawValue.split(', '));
}
}
}
});
所以我只想在组合框中选择两个选项。
如果我选择第三个,我想 - 什么都不会发生
谢谢! 它对我有用!
cols.offer.push({
dataIndex: 'show_at_index_as_tag_id',
header : 'Показывать на главной под тегом',
width:150,
editor : {
xtype : 'combo',
store : gridTagStore,
queryMode: 'local',
typeAhead: true,
displayField: 'name',
selectOnTab: true,
triggerAction: 'all',
lazyRender: true,
valueField: 'id',
multiSelect:true,
listClass: 'x-combo-list-small',
listeners: {
beforeselect : function(){
return (this.value.length == 1 && this.value[0] === "") || this.value.length == 0 ;
}
}
}
});
我决定只限制一个选项并使用多选,因为我存储了在其他应用程序中使用的选项。
但是我需要在这个组合中选择空值,所以选择一个选项的多选是很好的解决方案
【问题讨论】:
标签: extjs combobox multi-select