Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Frederic Lamsens on May 16, 2008 06:37
open dhtmlx forum
dhtmlxfolders: onclick and ondblclick

I just sent a question about onclick and ondblclick. I solved my problem by adding a delay to the onclick-event (code below).




dhtmlxFolders.prototype._onclickHandler=function(e)
{
        var id=this._trackParent(e);
        if (!id)
            return this.stopEdit();

         this.stopEdit();
        
        if ((e.ctrlKey)||(e.shiftKey)|| this.getItem(id).data.selected || (!this.matchSelected(function(id,ind){
                this.unselectAll();
                //if ((this._set.editable)&&(((new Date()).valueOf()-this._last_click_time) > 500))
                //    this.editItem(id);
        },id))){
            this.selectItem(id,e.ctrlKey,e.shiftKey);
        }
        
this._last_click_time=(new Date()).valueOf();




// @@flamsens
var self = this;
window.setTimeout( function() { eval("self.callEvent('onclick',[id]);") }, 250);




// this.callEvent("onclick",[id]);
return true;
}
Answer posted by Support on May 16, 2008 06:46

Yes, this is only correct solution ( as far as I can see )

I suggested some similar one in original thread
http://dhtmlx.com/docs/products/kb/index.shtml?cat=recent&q=3295