-
25 Nov 2011 1:23 AM #1
Unanswered: Ext.tree.panel is not loading
Unanswered: Ext.tree.panel is not loading
Hi,
I have a requirement where need to generate a tree from the server response.
Server response comes as JSONArray(Spring JSONArray) which contains root and child nodes.
Earlier have used TreePanel from Extjs3.x, it worked fine,
we migrated from Extjs3.x to Extjs4.x , now nothing is happening even server url is not hitting.
Tried using TreeStore but is not supporting JSONArray format, any help would be appriciated.
Please check the below code snippet for pannel definition.
var availsvcTree = Ext.create('Ext.tree.Panel',
{ id:'avail-tree-panel', width:280, height:250,
bodyStyle: 'background-color:white;',
frame: true,
folderSort:true,
loader: {
url:'/main/avail_tree.json'
},
autoScroll:true,
containerScroll: true,
root: {
text: 'Available Services',
id: 'source',
},
rootVisible: true
});
-
25 Nov 2011 1:42 AM #2Sencha - Services Team
- Join Date
- May 2007
- Location
- Munich (Germany)
- Posts
- 2,292
- Vote Rating
- 6
- Answers
- 57
i would definitely go for the treeStore, since it offers a lot of additional goodies.
it should not be a big deal to convert your array into an object:
Code:{success: true, data: myJSONarray}
-
28 Nov 2011 5:20 AM #3
Ext.data.TreStore isNode is noll or not an Object
Ext.data.TreStore isNode is noll or not an Object
Hi,
Have tried using the TreeStore to load the data to the Ext.tree.Panel.
While page loading the page am getting ' record.isNode is noll or not an Object' from NodeInterface , after clicking the node getting internalId is null or not an object.
Spent lot of time to resolve but no luck any help would be appricitaed.If possible pls provide sample code
Below code is the part of the response coming from Server.
Actually this is JSONArrayFormat.
{"id":4,"text":"Region","leaf":false,"children":[{"id":2219,"text":"AFRICA","leaf":false,"children":[{"id":5,"text":"Territory","leaf":false,"children":[{"id":2058,"text":"ALGERIA","leaf":false,"children":[{"id":6,"text":"SubTerritory","leaf":true}]}]}]}]}


Reply With Quote