13 Jun 2010 3:03 PM #1
One last designer/data question
What is the right way to load data manually into a Tree laid out in Extjs Designer?
Do i reset tree.loader to a new loader or is there a better/more elegant way to update the tree's data model programmatically (as opposed to loading from a a URL)
13 Jun 2010 4:52 PM #2
- Join Date
- Mar 2007
- Frederick, MD
- Vote Rating
You could use the TreeNode API and append children to your root node: http://www.extjs.com/deploy/dev/docs....tree.TreeNode
The TreeLoader offers the ability to load node data only from an http endpoint, and does a "preload" of children nodes. However, loading tree data manually usually means that you use the Node API directly to append children, recursively.
There is a private method in the TreeLoader class that you can use to setup all of your data at once. First, you can create a new TreeNode that specifies "children", much like you see in the TreeLoader example: http://www.extjs.com/deploy/dev/docs...ree.TreeLoader
After the node is created, you can set it as the root node for your TreePanel by calling setRootNode(). Once that's done, you can then call myTree.getLoader().doPreload(rootNode); which will setup all of your children nodes specified on your root node, recursively down the tree.
13 Jun 2010 6:43 PM #3
Terrific detail, thank you again!
My game is now communicating between client and server, though there is still a lot of work to be done. Its a multi-player text-adventure construction system. Here are a few screen shots of interfaces created with extjs & ext designer..
14 Sep 2010 3:26 AM #4
By wurstkuchen in forum Ext Designer: Help & DiscussionReplies: 5Last Post: 25 May 2010, 5:46 AM
By imegai in forum Ext Designer: Help & DiscussionReplies: 2Last Post: 12 May 2010, 7:35 AM
By Mango_lier in forum Ext Designer: Help & DiscussionReplies: 18Last Post: 27 Apr 2010, 2:28 AM