开发者

Dynatree multi - selection implementaion ala Windows style

开发者 https://www.devze.com 2022-12-28 02:35 出处:网络
I would like to implement windows style multi-selection: when user holds CTRL key and sele开发者_JAVA技巧cts several nodes of the tree.

I would like to implement windows style multi-selection:

when user holds CTRL key and sele开发者_JAVA技巧cts 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?


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);
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号