Firebug控制台输出:
this.proxy is undefined
SimpleStore()(Object params=Object)ext-all.js (行 43)
initComponent()("", true)ext-all.js (行 129)
initComponent()()ext-all.js (行 129)
camelFn()()ext-all.js (行 13)
getViewWidth()()ext-base.js (行 10)
[Break on this error] Ext.data.Store=function(A){this.data=new....data=C;this.resumeEvents();return B}});
js代码
[code="js"]
var root_arr = parent.getrootarr();
var classstore = new Ext.data.SimpleStore({
fields: ['id', 'class', 'parentId'],
data : root_arr
});
var combo = new Ext.form.ComboBox({
xtype:'combo',
store: classstore,
displayField:'class',
typeAhead: true,
mode: 'local',
forceSelection: true,
fieldLabel: '选择类别',
triggerAction: 'all',
emptyText:'选择一个类别...',
selectOnFocus:true,
listeners:{select:function(combo, record, index){
var value = record.get('id');
console.log(value);
/*classstore.filter('id',codeHead);
var newStore = new Ext.data.SimpleStore({fields: ['id', 'class','parentId']});
newStore.add(classstore.getRange());*/
var comboSub = Ext.getCmp('subclass');
if(!value){
comboSub.setRawValue('');
comboSub.disable();
return;
}
comboSub.enable();
comboSub.reset();
comboSub.clearValue();
[color=red]comboSub.store.filter('parentId',value,true);[/color]
}}
});
var comboSub = new Ext.form.ComboBox({
xtype:'combo',
fieldLabel: '子类别',
id:'subclass',
store: new Ext.data.SimpleStore({
fields: ['id', 'class', 'parentId'],
data : subclass_arr
}),
displayField:'class',
typeAhead: true,
mode : 'remote',
disabled : true,
forceSelection: true,
fieldLabel: '选择类别',
triggerAction: 'all',
emptyText:'选择一个子类别...',
selectOnFocus:true
});
[/code]