Sorry!
I answered the wrong email!!

This is the right one:D
---

I think a good way to store custom data in a TreeVirtual is to use:

setUserData(myNodeDisplayName, myCustomNodeObj).

//myCustomNodeObj is a self made class which stores the custom data for the 
node.
If all nodes have a unique labeltext, this would be enough.

You can use
----------
vTree.addEventListener("changeSelection", function(e){
        
        var selectedNodes = e.getData();
        var model = vTree.getDataModel();
        var lbl = selectedNodes[0].label;
        var obj = model.getUserData(lbl);
        var cont = new qx.ui.basic.Atom(        "ID: " + obj.getId() + 
                                                        "<br>Name: 
"+obj.getName()+
                                                        "<br>DisplayName: 
"+obj.getDisplayName());
                                                        
},this);
-------------------

Something like this should work...I guess ;)

If the labels are not unique you maybe should put the node-hierarchy as a 
prefix to the "setUserData"
setUserData(myNodeHierarchy+"/"+myNodeDisplayName, myCustomNodeObj).

Than it is unique ;)

Tobias

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von dperez
Gesendet: Montag, 28. Mai 2007 12:41
An: qooxdoo-devel@lists.sourceforge.net
Betreff: Re: [qooxdoo-devel] TreeVirtual custom node data


Hi Christian,

I use successfully
   myTreeModel.setState(node, {custom1: 'myvalue'});

Christian Boulanger (Bibliograph Development) wrote:
> 
> Hello,
> 
> what is the preferred way of attaching non-public custom data to the 
> nodes in the data model? For example, I want to attach node ids which 
> are different from the nodeId given by the data model? Can I set custom 
> properties to the node data through setState or there another way that 
> one should use?
> 

-- 
View this message in context: 
http://www.nabble.com/TreeVirtual-custom-node-data-tf3824154.html#a10834194
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to