I would like to dynamically define models to handle data from a data store.
I have a web service that returns different JSON structures (eg. field_1:"val1" or field_1:"val1 field_2:"val2" or field_1:"val1"...field_n:"valn"). I've seen that for using
Ext.regStore("UserStuffStore",{
model: "myModel",
proxy: {
type: 'ajax',
url: rl,
headers: {
'Accept' : 'application/json'
},
reader: {
type: 'json'
}
},
autoLoad: true
});
I need to specify a model. In this case, I need to see data structures before defining the model. How can I solve it?
Surely I can make two different calls to the web service (the first to get the data structures, the other to get data), is there another way?