Values from xml in EXTJS
I get a xml file with some data. I want to use some data to display in a displayfield and the rest in a grid. How can i do 开发者_如何学Cthis?
This is the xml:
<blocked><report><sourceFile>log.1</sourceFile><date>11-10-2011</date><total>52996</total><parseIssues>279</parseIssues><categories><category>
So i need date, parseissues and total in three displayfields used in a panel. The categories are used in a grid. The categories are not a problem, i got them working but how do i display the other values outside the grid?
you can use this code block for following XML data.
var store = new Ext.data.Store({ url: 'somefile.xml', reader: new Ext.data.XmlReader({ record: 'element', fields: ['title', 'name'] }) });
Here is an XML format that should work with the code.
<elements> <element> <title>sfdsf</title> <name>dfddfs</name> </element> <element> <title>bla</title> <name>rtz</name> </element> <element> <title>xsd</title> <name>awe</name> </element> </elements>
For more detailed information please go to this page on Sencha forum.
精彩评论