View Full Version : Tree panel from xml using attributes with parent child heirarchy

18 Aug 2013, 10:38 PM
I am trying to load a tree panel from below xml :

<?xml version="1.0"?>
<CriteriaBuilder TITLE="New page">
<F LB="Search Criteria" M="0" Bid="0">
<F LB="Document Attributes" Bid="B8" PARENTLEVEL="1" expanded="true">
<F A="32" LB="Document Type" Bid="B10" DT="698" DTY="4" MinChar="1" FN="CAS10" KEYWORD="DOCUMENT" />
<F A="32" LB="Keyword" Bid="B13" DT="792" DTY="4" MinChar="1" FN="CAS11" KEYWORD="KEYWORD" />
<F A="32" LB="Second Level Keyword" Bid="B16" DT="801" DTY="4" MinChar="1" FN="BODY" KEYWORD="KEYWORD2" />
<F A="32" LB="A &amp; D" Bid="B11" DT="698" DTY="10" MinChar="1" FN="CAS15" AV="YES|NO" KEYWORD="A&amp;D" />
<F A="32" LB="Published Date" Bid="B12" DTY="3" FN="CAD1" KEYWORD="PUB DATE"/>
<F LB="Common Attributes" Bid="B15" PARENTLEVEL="1" expanded="true">
<F A="32" LB="Source" Bid="B9" DTY="4" DT="740" FN="CAS11" MinChar="1" KEYWORD="COMPANYNAME" RELATEDFIELDS="B3,B9" FN1="OPERATORDOMAINID" />

From this xml I want to display all LB attribute values as the node text and the main thing is child heirarchy should be same as in xml. on expanding Document attributes I want all other leaf . similarly on expland of Common Attributes I want Source leaf to be displayed under Common Attributes
The major problem I faced here is both parent and child elements are with C tag only. SO if i tell my record as C both will be displayed flat.
I refered some urls but they couldn't help me for either
nested xml elements with same tag name,
or with node name in attribute not as element value
I appreciate a help. I am using ExtJS 4.2.1 version.

urls I refered :

2> http://www.sencha.com/forum/showthread.php?3987-Create-an-Ext.tree.TreePanel-from-an-XML-document
The tree panel should be loaded only once not on expand of any parent.
All the child should be loaded depending on the mentioned hierarchy.

Thanks In Advance.

Gary Schlosberg
22 Aug 2013, 12:22 PM
You might get more response from the community if you post the code that you've written so far. Here's a more recent forum post that might be helpful: