Light Mouse Navigation & onClick event

If possible, I would like to use:

   grid.enableLightMouseNavigation(true)

and I need to capture a single row click.

I found an old thread that said to use this function:

dhtmlxEvent(grid.obj,"click",function(e){
       var el = grid.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");
       var ind=el._cellIndex;
       var id=el.parentNode.idd;
       //any custom code here
 });

Is this still the recommended solution?

You may try to use the listed solution or use

mygrid.enableEditEvents(true,false,true);

Also you may try to use enableRowsHover() method instead of enableLightMouseNavigation()
docs.dhtmlx.com/doku.php?id=dhtm … erowshover

I like enableRowsHover(). Is it possible for it to use the default class of the skin instead of defining one via a style?

I am now using all of the skins (sky, salad, sand, etc…)

I think I will use the dhtmlxEvent along with enableLightMouseNavigation. This is working well.

I’ve been using dhtmlxEvent for detecting events, I decided to create a prototype and share it:

dhtmlXGridObject.prototype.onClick = function(cb){	
  var that=this;
  dhtmlxEvent(that['obj'],"click",function(e){
		var el  = that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");
		var rId = el.parentNode.idd;
		var cId = el._cellIndex;
		var v   = that.cells(rId, 0).getValue()
    cb.apply(that, [rId, cId, v]);
	})
}

This can be used as:

  myGrid.onClick(function(rId, cId, v){
    console.log(arguments);
    console.log(this.getRowsNum());
   })