View Full Version : Store load listener

18 Jun 2013, 8:34 AM
I'm currently using Ext 4.1.1 and I'm trying to add a load listener to a combobox's store...or any of my stores for that matter and I continue to get a null pointer when trying to add it. My code is below, any idea why I'm getting this?

TypeError: config is undefined


...ner(item, ename, config.fn || config, config.scope || options.scope, config.fn ?...


xtype: 'combobox',
itemId: 'accountFilter',
name: 'account',
submitValue: 'false',
store: 'Accounts',
queryMode: 'local',
displayField: 'display',
valueField: 'id',
listeners: {
'store': {
'load': this.selectDefaultAcct

I'm hoping the code is pretty straightforward but the only way I can seem to get the load listener to work is to manually call store.load with a callback. Which works fine usually but I can't manually call the store's load method in this case.

Thanks in advance.

18 Jun 2013, 8:41 AM
Found it as soon as I posted. I had both the items setup and the method declaration in the initComponent function. As soon as I moved the callback out of initComponent it worked fine.