-
1 Sep 2008 5:08 AM #1
JSON and TreePanel
JSON and TreePanel
Can anyone help me, why I could not get my tree nodes from JSON file?Code:new Ext.tree.TreePanel({ rootVisible:true, layout:'fit', loader: new Ext.tree.TreeLoader({ requestMethod: 'GET', dataUrl:'XmlTreeLoader.json' }), root: new Ext.tree.AsyncTreeNode({ draggable:false, text:langResStr_tasks }) })
-
2 Sep 2008 4:59 AM #2
I am still could not add my JSON file data into tree...
I searched all examples but nothing found.
Please somebody who has tried this before help me.
-
2 Sep 2008 5:33 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Try adding a loadexception handler to the loader to see if the data loads correctly.
ps. XHR requires that XmlTreeLoader.json is served from a HTTP server. If XmlTreeLoader.json is a file on the local file system you need to include ext-basex.
-
2 Sep 2008 5:41 AM #4
I tried showing my file and its total count shows '0'.
Also, I do not understand why I need ext-basex.
-
2 Sep 2008 6:41 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
1. Are you testing local files or files on a webserver?
2. Did you get a 'load' event or a 'loadexception' event in the TreeLoader?
-
2 Sep 2008 6:50 AM #6
I am using local file and I load it.
I did not take any exception.
Therefore,I did not include loadexception.
Is it necessary in this situation?
-
2 Sep 2008 6:52 AM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
ExtJS can't load local files.
The ext-basex user extension adds support for loading local files.
-
2 Sep 2008 6:57 AM #8
I include this but nothing change.
Once I have load local data from json to
my gridpanel but I could not achieve for treepanel.
This is confused my mind. Nobody has any example
which includes json and treepanel? and also treepanel
take nodes and leaves from json.
Please..
-
2 Sep 2008 7:01 AM #9Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Are you including ext-basex-min.js after ext-all.js in your HTML?
-
2 Sep 2008 10:25 PM #10
Yes, but nothing has changed


Reply With Quote