Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by josh on Dec 14, 2008 20:52
open dhtmlx forum
dhtmlx events

Hi,

i was just wondering whether all the dhtmlx events has an "event" argument??
It is pretty useful to retrieve position of the cursor (x,y coordinates) so that we could add new ui's upon these events!

- Is there a way to add these to at least the onclick/select events? or do they exist already?


thanks,


Answer posted by Support on Dec 15, 2008 02:15
Most event not provide native event object, instead they provides ID of related item|row|cell.

>>- Is there a way to add these to at least the onclick/select events? 
There is no easy way to add such functionality ( can be done only by code modification )
If you interested - we can provide info about exact places where code need to be changed. 

Answer posted by josh on Dec 15, 2008 05:58

>>If you interested - we can provide info about exact places where code need to be changed. 
yes, i would be interested in knowing.

>>instead they provides ID of related item|row|cell
from these arguments, is there a way to get some x,y location on the screen? maybe the position of the cell?

 

 

thanks,

Answer posted by Support on Dec 15, 2008 07:16
>> maybe the position of the cell?
var pos = grid.getPosition(grid.cells(id,ind).cell);
//pos  is an array of [x,y]

>>yes, i would be interested in knowing.
dhtmlxgrid.js , line 1135
this._doClick=function(ev){
....
this.doClick(el, fl, selMethod)
can be replaced with 
this.doClick(el, fl, selMethod,true,ev)


line 1272
  if ((!skipRowSelection)&&(!el.parentNode._sRow)){
  if (this.callEvent("onBeforeSelect", [
  el.parentNode.idd,
  psid
  ])){

can be replaced with
  if ((!skipRowSelection)&&(!el.parentNode._sRow)){
  if (this.callEvent("onBeforeSelect", [
  el.parentNode.idd,
  psid,
  arguments[4]
  ])){


It will add native event object to onBeforeSelect event