Php 第二个组合框在更改第一个组合框时加载
我有三个组合框 在选择第一个时,我希望第二个和第三个组合框加载相应的值。 这是我的代码片段Php 第二个组合框在更改第一个组合框时加载,php,extjs,extjs4,Php,Extjs,Extjs4,我有三个组合框 在选择第一个时,我希望第二个和第三个组合框加载相应的值。 这是我的代码片段 { xtype : 'combo', store : 'product.CategoryComboBox', name: 'category', displayField: 'name',
{
xtype : 'combo',
store : 'product.CategoryComboBox',
name: 'category',
displayField: 'name',
valueField: 'idProductCategory',
multiSelect : false,
fieldLabel: 'Category',
allowBlank: false,
allowQueryAll : false,
forceSelection : true,
typeAhead: true,
triggerAction: 'all',
delimiter : ',',
width: 300,
mode: 'local',
listeners:{select:{fn:function(combo, value) {
var attribute = Ext.getCmp('attributes');
var feature = Ext.getCmp('features');
attribute.setValue('');
attribute.store.removeAll();
attribute.setDisabled(false);
attribute.store.load({
params: {id: 5}
});
feature.setValue('');
feature.setDisabled(false);
feature.store.removeAll();
feature.store.load({
params: {id: 5}
});
//attribute.store.filter('abbr', 1);
}}}
}
这里我遇到的问题是,我必须先选择第二个和第三个组合框,然后选择第一个组合框才能正确加载数据。
如果先选择第一个组合,则第二个和第三个组合上都不会加载选项 使用change listener而不是select listener,我想你会成功的