PDA

View Full Version : XML Grid - Picking grid column names from XML



noor.mujeeb
8 Apr 2011, 4:04 AM
Hi,

My situation is simple. I want to bind a ext grid with an xml document. I want the column names of the grid to be same as node names. For example below is a simple XML, I just have to bind exactly the same way to a ext grid. I dont want to hard code the column names while creating the grid variable.



<?xml version="1.0"?>
<ROOT>This is the text of the root element
<Data>
<field1>43</field1>
<Field2>1</field2>
</Data>
<Data>
<field1>43</field1>
<Field2>1</field2>
</Data>
</ROOT>



I am not finding an example on this. Can anyone plz help.? Thank you all for your replies.

I am loving my experience with Ext JS. :)

fay
8 Apr 2011, 4:27 AM
Search the forums for DynamicXMLReader - it's not exactly what you want, but it should point you in the right direction.

noor.mujeeb
8 Apr 2011, 6:29 AM
HI fay,
Frist of all, thank you for your reply.

I did some search as per your suggestion, clearly its not straight forward (not sure why). I think I should build my ColumnModel by using DOMPARSER to read the node names.

Is there any sample that you have for this. I am asking this because I am new to ExtJs and I may end up spending lot of time for this.