PDA

View Full Version : Sencha EXT json not loaded if not correct to model



mirkotus
12 Dec 2013, 1:02 AM
I have a Store which is connected to a model. I dynamically load different JSON structures to this store. Somethimes the JSON structures are different from the model. All the different values don't get loaded.
Example:


**Model:** name id description
**JSON:** [{"name":"John", "id":"2", "description": "Doe", "age": "23"}] In this case age woun't get loaded into the store because it is not specified in the model. How can I achieve loading this values into the store without changing the model. Is this even possible?
Another thing: What about relationships? In Sencha Architect you can specify realations between models. The properties which belong to a relationship also woun't get loaded.
Example:


**Model:** id name relationship: hasManyPets
**JSON:** [{"id":"1", "name":"John", "pets":[{//somePet},{//somePet}]]In this case pets woun't get loaded even if they are present in the model and specifed under a relationship.

Ilay
12 Dec 2013, 3:06 AM
http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.data.Store-method-loadData