Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by sandro on Jan 16, 2008 19:01
open dhtmlx forum
how do i detect grid object?

Hi,

I have several grids on the same page. When a user does something (lets say onMouseOver of a cell), i need to determine which grid i'm on -- i need the actual grid reference, or even the id of the html element that contains the grid.

I see no way to do this. Is there some reference, somewhere, that I can check on grid mouseover, or indeed any even on the grid? it's surprising that the events for the grid don't actually pass the grid reference to the handler function.

great product

Sandro
Answer posted on Jan 17, 2008 02:13
>> it's surprising that the events for the grid don't actually pass the grid reference to the handler function

Inside all grid events you can use "this" as reference to the grid object, for which event occured

grid.attachEvent("onMouseOver",function(id,ind){
       //here this == grid
       this.addRow(...
});