views:

48

answers:

1

I would like to implement windows style multi-selection:

when user holds CTRL key and selects several nodes of the tree. Dynatree (from here http://wwwendt.de/tech/dynatree/doc/dynatree-doc.html) by default has checkboxes for node selection which my client doesn't seem to like.

My question is, is it possible to implement what I need using provided set of callbacks? also, curently, when I hold CTRL key and click on the node, it opens a new window. Is there any way to suppress this functionality? i am guess I would have to do through CSS?

A: 

Have a look at the sample and source code here http://wwwendt.de/tech/dynatree/doc/sample-select.html

The last example on that page uses the checkbox: false tree option to hide the checkboxes. The onClick handler calls dtnode.toggleSelection().

This could be replaced by something like

if not CTRL pressed:
    deselect all nodes
toggle selection

Desecting all nodes could be done like this:

tree.visit(function(dtnode) {
    dtnode.select(false);
});
mar10
thank you! i will take a look. thanks for the great component, by the way. i love working with it.
gnomixa