PDA

View Full Version : xmlReader sends back response with malformed XML



farrellk
12 Aug 2015, 3:08 AM
Hi guys!

I have xml which looks something like this


<root>
<default>
<subTag>
<id>stuff</id>
</subTage>
</default>
<override>
<subTag>
<id>stuff</id>
</subTage>
<subTag>
<id>stuff</id>
</subTage>
</override>
</root>


my xmlReader using a path to define the record and is working correctly and as needed. My only issue now is when the update response is sent back to the server the grid row tag I guess you can call it is creating malformed xml



<default/subTag>
<id>stuff</id>
</default/subTag>


I would like it to create response like

<subTag>
<id>stuff</id>
</subTag>


Any suggestions or ideas on how to fix this? Here is my Store definition.

Thanks!



var store = new Ext.data.Store({
id: 'defaultStore',
proxy : new Ext.data.HttpProxy({
api : {
read: link,
update: linkUpdate
}
}),
reader: new Ext.data.XmlReader({
idPath: 'DTRow',
record:'default/subTag',
}, ['DTRow',...... ],
partialUpdate : true,
autoLoad : true
});

mitchellsimoens
19 Aug 2015, 5:42 AM
What happens if you specify record as 'subTag'? Been a while since I've used Ext 3 with XML reader but hopefully it would traverse to find the record node.

farrellk
19 Aug 2015, 6:02 AM
Hey thanks for your response, I finally got this to work. I figured out it was to do with the way the object which is sent back to our server was created. I wrote a function that took a string like one/two/three/four and created object one.two.three.four.