PDA

View Full Version : Ext.data.Store reader xml does not map values to model



chitgoks
10 Sep 2012, 12:02 AM
var store = Ext.create('Ext.data.Store', {
model: 'mymodel.model.WorkItemQueue',
autoLoad: true,
proxy: {
type: 'memory',
reader: {
type: 'xml',
rootProperty: 'root',
record: 'user',
idProperty: 'id'
}
}
});


then i call workitemListStore.loadData(doc); where doc is from new DOMParser().parseFromString(xmlstring, 'text/xml');

i actually am able to get the value of the model's id (since I specified it in idProperty). however, the other fields of model User contain null values.

am i missing something? any ideas?

mitchellsimoens
11 Sep 2012, 12:58 PM
Why not use an ajax proxy to remotely load the xml?

chitgoks
11 Sep 2012, 2:12 PM
i also plan to do that. i just wanted to see how it works if i load it locally through a declared variable with xml string.

i managed to solve it now. the only thing lacking in my model class is that there is no mapping. the docs never mentioned that