如何从一个商店添加两个组合框具有type
字段女巫值可以是1, 2 and 3
我想要1 and 2
在第一个组合框和2 and 3
第二个组合框中键入的记录。
我的组合框:
Ext.define('Exp.view.settings.servers.ComboBox', {
extend: 'Ext.form.ComboBox',
alias : 'widget.server_combobox',
xtype: 'combobox',
displayField: 'name',
valueField: 'id',
name: 'server',
store: 'Servers'
});
存储:(只是来自带有 json 阅读器的服务器的示例数据)
Ext.define('Exp.store.Servers', {
extend: 'Ext.data.Store',
model: 'Exp.model.Server',
autoLoad: true,
autoSync: true,
data: [{
id: 1,
name: 'Server 1',
type: 1
},{
id: 2,
name: 'Server 2',
type: 3
},{
id: 3,
name: 'Server 3',
type: 2
}]
});
如果我使用商店过滤器,两个组合框都会被过滤。现在我创建了两个商店,但这意味着对服务器的两个 ajax 调用,我不太喜欢这样。