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
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. :
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
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
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.
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