PDA

View Full Version : Wierd/Mystery TypeError ONLY with MVC objects



bastard
9 Sep 2011, 6:25 PM
Very often I'll get a mystery TypeError when I set object such as MyApp.X.Y - but when I contract my object to MyApp.X, the error goes away. Here is an example of the error:
TypeError: Cannot set property of 'ListStore' of undefined


for example:


MyApp.store.ListStore = new Ext.data.Store({...});

^^^ above will cause the TypeError on the line above :-?:-?:-?

But when all I do is contract the object as below, the error goes away. :-/:-/:-/

MyApp.ListStore = new Ext.data.Store({...}); // note: i've removed the .store.

What am i missing???? At first it was just an annoyance, but now it's actually become debilitating. :((

bastard
10 Sep 2011, 2:27 PM
Got it!

Incase anyone else has this error, it's because your objects need to map to your subdirectories. My directory was labeled stores (not store). Not quite sure why removing the store was causing it to work though.