Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by soms on May 04, 2009 21:30
open dhtmlx forum
Highlight grid cell text on double click

Hi

I had earlier asked this question in reply to which you sent me the below solution.

if (stage==1&&this.editor.obj&&this.editor.obj.select)

{

this.editor.obj.select();

}

This works perfectly fine but on some grids it is throwing me "this.editor.obj is null or not an object" error. Any idea why this is happening?

Answer posted by Alex (support) on May 05, 2009 04:19

Hello, 

please, provide a sample that allows to reproduce the problem. editor object must always exist when it's opened (stage 1).

Answer posted by dhxSupport on May 05, 2009 04:29

Try to call mygrid.attachEvent("onEditCell",...) after grid was fully loaded:

mygrid.loadXML("grid.xml",function(){

 mygrid.attachEvent("onEditCell",function(stage,rowId,cellInd,newValue,oldValue){
  if (stage==1&&this.editor.obj&&this.editor.obj.select){
  this.editor.obj.select();
  }
  return true;
  })   
  });