Hi all, I'm trying to parse a deeply-nested offline JSON object to an existing Model but unable to populate the associations.It's a complicated Model with many direct & nested associations. I request the fully-bloomed JSON object from the server once & store it as a string locally for later offline usage. I've tried the following but unsuccessful so far(say 'json' is the offline JSON string):
Code:
Ext.create('The.Model', Ext.decode(json)));
As per documentation somewhere, this doesn't process the associations.Code:
Ext.create('Ext.data.Store', {
autoLoad: true,
model: 'The.Model',
data: [Ext.decode(json)],
proxy: { // The.Model has a REST proxy defined, need to switch proxy when offline
type: 'memory',
reader: {
type: 'json'
}
}
});
This doesn't work either.- I've tried the following: http://ift.tt/1Bk1AQo
But it seems for Ext JS 4, which doesn't work under 5.0.1 here.
Any help is appreciated, thank you!
Convert JSON to Model with associations
Aucun commentaire:
Enregistrer un commentaire