PDA

View Full Version : Unable to load tree data wen it has special characters



kanthu509
1 Aug 2012, 4:48 AM
hi,

I'm facing an issue regarding tree data.wen we have data like <b>, the data is not loading in the tree panel..
How to load the data wen special characters are there.Here i'm loading the data dynamically.I'm getting issue while loading the data dynamically.


Thanks,
Srikanth.B

sword-it
1 Aug 2012, 5:26 AM
Hi,


you can use following code:




var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "detention", leaf: true },
{ text: "<b>homework", expanded: true, children: [
{ text: "book report", leaf: true },
{ text: "alegrbra", leaf: true}
] },
{ text: "buy <b> <i>lottery tickets", leaf: true }
]
}
});


Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody()
});



For more detail see this link: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.Panel

(http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tree.Panel) OutPut :

37671