Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by mini on Sep 08, 2009 11:06
open dhtmlx forum
DHTMLXScheduler - Get position of click

I'm making a totally custom detailview and would like to position the div where the user clicked to add item .
Is there a property or function to retrieve this?

Answer posted by Support on Sep 09, 2009 01:31
You can wrap native onclick handler and fetch all necessary data from it

var old = scheduler._click.dhx_cal_data;
scheduler._click.dhx_cal_data = function(e){
           var ev = e||event; //native event object

          var x = ev.pageX||ev.clientX;
          var y = ev.pageY||ev.clientY;

          ...any custom logic here...

          //call original handler
          old.apply(this,arguments);
}


Also onClick, onDblClick, onEventCreated events provide native html event object as second parameter, so you can use it to get info about position of related click .