Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Frederic Lamsens on Aug 05, 2008 04:44
open dhtmlx forum
dhtmlxtree enableMultiselection & onClick

When I enable multiselection and add an onClick-event (to open a new page), the event is fired when I try to select multiple items. Is there a way to prevent this? Or is there a way to get the state of the control-key when the event was fired?
Answer posted by Support on Aug 05, 2008 07:58

>>Is there a way to prevent this?
Nope, the event will be called for any click on tree item.

>>Or is there a way to get the state of the control-key when the event was fired?
Default code doesn't provide such info, but it can be easily modified
dhtmlxtree.js, line 1633
 else that.callEvent("onClick",[obj.id,lastId]);
can be changed to 
 else that.callEvent("onClick",[obj.id,lastId,e.ctrlKey]);

As result event handler, will receive state of ctrl key as third parameter