||View All MessagesBack to WebFX|
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
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
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.
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.