Select/Show Row in split mode grid

Hi,

I have a grid which is split at 3rd column, i.e. index=2 as below. In order to let the user scroll the grid manually and to keep both sides of the grid, i.e. the rows, such that they are aligned I have used the code as suggested here -: http://forum.dhtmlx.com/viewtopic.php?f=2&t=25401.

So the complete code is:-

function loadGrid(){
   ....
   mygrid.enableLightMouseNavigation(true);
   mygrid.init();
   mygrid.moveToVisible=function(){};
   mygrid.splitAt(3);
   mygrid._fake.moveToVisible=function(){};
   ....

Now, I want to implement the functionality with which user can enter a column cell value and click on the button saying Show Row. as a result the row should be shown or selected or automatic scroll should be done and that row would be visible to user. So I have implemented a function below:-

function showRow(){
	var rowToShowVal = document.getElementById("rowToShowVal").value;
	var rows = mygrid.getRowsNum();
	for (var i = 1; i < rows; i++) {
		var cellVal = mygrid.cells(i, 1).getValue().toString();
		if(rowToShowVal==cellVal){
			var rowID = mygrid.getRowId(i);
			mygrid.setSelectedRow(rowID);
//I have also tried mygrid.showRow(mygrid.getRowId(i)); but this does not work either.
			break;
		}
	}
}

Now the issue is when I remove the below three lines from loadGrid() function, the showRow() function works perfectly fine, however I want this to work with the below lines of code:-

   mygrid.moveToVisible=function(){};
   mygrid.splitAt(3);
   mygrid._fake.moveToVisible=function(){};

Please suggest how to select or show the row in grid with split mode without removing above lines of code.

Thanks,
Sam

Instead of:

mygrid.enableLightMouseNavigation(true); ... mygrid.moveToVisible=function(){}; mygrid._fake.moveToVisible=function(){};

you may try to use the following code:

mygrid.enableRowsHover(true,"hover"); mygrid.attachEvent("onMouseOver", function(id,ind){ mygrid.selectRow(mygrid.getRowIndex(id),false,false,false); });

Thanks Sematik. Your suggestion worked perfectly fine.

By removing the below line, the user has to double click on a cell to edit the value. Is there any way with which user can open the cell editor on single click. Please advise.

function loadGrid(){
   ....
   mygrid.enableLightMouseNavigation(true);
   ....
}

Thanks,
Sam

You may try to use the enableEditEvents() method:

mygrid.enableEditEvents(true,false,false);

Thanks Sematik. It worked.