PDA

View Full Version : How to render tree with check box where dataUrl is XML ?



Namrata_lumiplan
18 Dec 2011, 10:14 PM
Hello All,

I m newbie to Ext JS.
am able to set up JSON as dataUrl for tree with checkbox.
I need help to render tree with check box where dataUrl is XML.


Thanks in Advance,
Namrata

tvanzoelen
19 Dec 2011, 3:51 AM
See this example http://docs.sencha.com/ext-js/4-0/#!/example/tree/xml-tree.html how to read xml in the tree.

The code for the checkbox remains the same

Namrata_lumiplan
19 Dec 2011, 4:01 AM
tvanzoelen (http://www.sencha.com/forum/member.php?32684-tvanzoelen)

Thanks a lot for ur reply.

I am working with Ext JS 3.3.
I have tried adding attribute 'checked = true' for each node in the XML, but still not getting tree with CheckBox renderer.

Please let me know right way to achieve this.

tvanzoelen
19 Dec 2011, 4:07 AM
Then you must ask this question to the ExtJs 3 forum.
But... by sure you set the record property in the reader. In json it is root.



var myReader = new Ext.data.XmlReader({
record: "row", // The repeated element which contains row information
idProperty: "id" // The element within the row that provides an ID for the record (optional)
(optional)
}, Employee);

Namrata_lumiplan
19 Dec 2011, 6:15 AM
Thanks tvanzoelen (http://www.sencha.com/forum/member.php?32684-tvanzoelen)

I got solution.
I have added 'attribute.checked = true' while loading XML by 'XmlTreeLoader'