PDA

View Full Version : Store not loading in extjs4 panel



srikanthreddy karnati
3 Sep 2014, 6:19 AM
Hi

This code I've written in my view file since store is not loading properly and I'm getting error at alert(PortfolioStore.getCount()); and PortfolioStore.load();

Errors:
Uncaught TypeError: Cannot read property 'getCount' of undefined
Uncaught TypeError: Cannot read property 'load' of undefined



listeners : {
beforerender : function() {
alert('before rendering');
PortfolioStore = Ext.data.StoreManager.lookup('PortFolioStore');
alert(PortfolioStore.getCount());
PortfolioStore.load();
}},

Note: PortFolioStore is my store and everything is running fine model,store,app.js


Thanks in advance!!!

scottmartin
3 Sep 2014, 6:29 AM
alert(PortfolioStore.getCount());
PortfolioStore.load();


You are trying to get the count before your load? You would need to get the count on the store onLoad event.