dhtmlxfolders: onclick and ondblclick

When I enable the events “onclick” and “ondblclick” at the same time in dhtmlxfolders, the onclick-event is fired on every double-click. Is there a way to solve this?


>>Is there a way to solve this?



Unfortunately no. The browser generates a lot of events when doubleclick occurs, and there is no way to differ real onclick event from onclick generated during doubleclick
( to make thing worse, each broser generates its own set of events in case of dbl-click )
The same actual for any dhtmlx component.



The only possible workaround - use timeout with onclick event



var ctr=null;
folders.attachEvent(“onclick”,function(){
    ctr = window.setTimeout(function(){
               // real onclick code
    },500)
});



folders.attachEvent(“ondblclick”,function(){
     window.clearTimeout(ctr);
     //real ondblclick code
});