WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Custom XTree IDs, Rick Ross, January 24, 2004
     Re:Custom XTree IDs, Erik Arvidsson, January 26, 2004
         Re:Custom XTree IDs, Rick Ross, January 28, 2004
             Re:Custom XTree IDs, Erik Arvidsson, January 28, 2004
                 Re:Custom XTree IDs, Rick Ross, January 29, 2004

Subject: Re:Custom XTree IDs From: Rick Ross Date: January 28, 2004
If you mean setting the id of the live object once it has been created, that didn't work. A simple test (as I am a simple person) is to try it right on the demo. In tree.js, I added a line :

var b = new WebFXTreeItem('1.1');
b.id = 'rickid'; // this is what I added
a.add(b);

The tree starts ok, but the node 1.1 will not open and the following message

Error: this.all[oItem.id.replace("-icon", "")] has no properties
Source File: file:///T:/webapps/xtree/xtree.js
Line: 97

Now the WebFXTreeHandler is the only thing that actually dispenses id's. However, I was not able to come up with a strategy that would get an ID from my script (like tree.js) into the WebFXTreeHandler. So instead, I tried bypassing it all together (id only) by adding an id field to the constructor of WebFXAbstractTreeItem and passing it in to WebFXTree etc.. this failed to draw the tree.

In the long run, I need to be able to select nodes and operate on them via the id I pass in. Any other thoughts you have would be greatly appreciated.

Rick

[Erik wrote]
You should be able to set the id before the HTML elements for the tree node is created. Once the HTML elements are created it is not a good idea to change the id.

erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX