-
24 Apr 2008 10:40 AM #1
Getting started with ExtJS and having issues with Async Tree
Getting started with ExtJS and having issues with Async Tree
Hello all,
I'm just getting started with ExtJS so I am a little confused. I pretty much did a straight copy and paste of the drag-and-drop tree example, I'm getting this:
[{"id": "1","text": "child","leaf: True}]);
as a successful response back from the server but all I am getting is a box with 1 list item (Ext JS)
I would *greatly, greatly* appreciate any help here. Thanks in advance!
Code:Ext.onReady(function(){ // shorthand var Tree = Ext.tree; var tree = new Tree.TreePanel({ el:'tree-div', useArrows:true, autoScroll:true, animate:true, enableDD:true, containerScroll: true, loader: new Tree.TreeLoader({ dataUrl:'Manage/Tree' }) }); var root = new Tree.AsyncTreeNode({ text: 'Ext JS', draggable:false, id:'0' }); tree.setRootNode(root); // render the tree tree.render(); root.expand(); });
-
24 Apr 2008 10:45 AM #2
Here is the response from my server-side app (Asp.net MVC):
Code:<head> <script src="../../Content/Scripts/ext-base.js" type="text/javascript"></script> <script src="/Content/Scripts/ext-all.js" type="text/javascript"></script> <script src="../../Content/Scripts/exttree.js" type="text/javascript"></script> </head> <div id="tree-div" style="overflow:auto; height:300px;width:250px;border:1px solid #c3daf9;"></div> </body></html>
-
24 Apr 2008 12:57 PM #3
If I use the JSON that comes with the example, it seems to work - (I realize there was a misplaced quote in the first) but I really don't see how I am messing up.. I am using the JSON straight from the API :/ Again, any help would be greatly appreciated, thanks!
-
25 Apr 2008 3:55 PM #4
I'd recommend you to look into the tree loader....
What exactly are you trying to do ?
Mehdi
-
25 Apr 2008 4:49 PM #5
I have, thats where I got the API for the JSON from (well not what I posted exactly.. that was the result of trying to mimic the post-back of the example moreso than the API). All I am trying to do at the moment is simply pass back the children of the node and have them load.


Reply With Quote