Re: [qooxdoo-devel] How to select an item in treevirtual

2007-04-10 Thread dperez
Your explanation is very useful. Thanks again Derrell. Here is the code for selecting any nodeId in a treevirtual: var row = mod.getNodeRowMap()[nodeId] tree.getSelectionModel().setSelectionInterval(row, row); Hope it will be useful to anybody else. Derrell.Lipman wrote: > > You may find

Re: [qooxdoo-devel] How to select an item in treevirtual

2007-03-21 Thread dperez
Again, I answer myself. ;-) The event is called correctly. I selected the item before registering the event handler. TreeVirtual._calculateSelectedNodes() shows the relationship between nodeId and row indexes. Maybe an API for easily selecting items could be made. So everything is answered. :

Re: [qooxdoo-devel] How to select an item in treevirtual

2007-03-21 Thread Derrell . Lipman
dperez <[EMAIL PROTECTED]> writes: > I have this code to populate a treevirtual: > > var root = menu.getDataModel().addBranch(null, "Root", true); > // add more items > tree.getSelectionModel().setSelectionInterval(root, root); > > but I don't know how to initially select programm

Re: [qooxdoo-devel] How to select an item in treevirtual

2007-03-21 Thread dperez
tree.getSelectionModel().setSelectionInterval(0, 0) works (selects the root node) but the changeSelection event isn't fired. Never mind, I can call the event manually. dperez wrote: > > Hi, > > I have this code to populate a treevirtual: > > var root = tree.getDataModel().addBranch(n

Re: [qooxdoo-devel] How to select an item in treevirtual

2007-03-21 Thread dperez
I made a small typo. Here is the code: var root = tree.getDataModel().addBranch(null, "Root", true); // add more items tree.getSelectionModel().setSelectionInterval(root, root); dperez wrote: > > Hi, > > I have this code to populate a treevirtual: > > var root = tree.

[qooxdoo-devel] How to select an item in treevirtual

2007-03-21 Thread dperez
Hi, I have this code to populate a treevirtual: var root = menu.getDataModel().addBranch(null, "Root", true); // add more items tree.getSelectionModel().setSelectionInterval(root, root); but I don't know how to initially select programmatically the root node. The code shown abov