-
12 Jan 2013 8:48 AM #1
AppName.model. Model prefix
AppName.model. Model prefix
In SA I add some models and define some relationships between them. I want to use:
to get hasMany related store, but there isn't. Because SA defines my model like DB.model.Address but not just Address and I have:Code:var store = person.addresses()
property with related store.Code:var store = person["db.model.addresses"]
How to say SA do not prefix models with AppName.model.?
-
14 Jan 2013 3:21 PM #2
Does setting the 'name' config of the HasMany association give you what you want?
http://docs.sencha.com/ext-js/4-1/#!...sMany-cfg-nameJason Johnston
@lojjic
Sencha Architect Development Team
-
15 Jan 2013 5:43 AM #3
Yes, thanks, one more question:
Is there way to prevent loading hasOne association remotely? For my case if json of parent record has nested (hasOne) data then I want to use it else I didn't want ot load them remotely (becouse if json does not contains hasOne data, there is no data on the server and it only creates wrang requests)? Now I use dirty hack:
instead of:Code:var address = personAddress["DB.model.AddressHasOneInstance"];
Code:var address = personAddress.getAddress(); // invokes unuseful request if no address: {...} were in personaddress JSON
-
15 Jan 2013 8:02 AM #4
I don't know the answer to your followup question unfortunately. Since it's a framework-related question (not Architect specific) you'd have better luck asking in the Ext JS or Sencha Touch forums. I hope you can find your answer there.
Jason Johnston
@lojjic
Sencha Architect Development Team


Reply With Quote