GRID: Turn off LightMouseNavigation when mouse moves outside


I want to “un-hilight” rows when the user moves the mouse outside a grid with enableLightMouseNavigation=true;

I found the following solution already provided by you…

>> There is no API call , but can be done with next two lines of code


>> mygrid = new dhtmlXGridObject(‘gridbox’);

>> …

>> dhtmlxEvent(mygrid.entBox,“mousemove”,function(e){ (e||event).cancelBubble=true;});

>> dhtmlxEvent(document.body,“mousemove”,function(){ mygrid.clearSelection(); });

But there are 3 problems with it:

1. If a cell is being edited, and the user moves the mouse away from the grid, then the active cell is un-selected as well. I want the hilighting to be removed ONLY IF a cell is not currently being edited.

2. The above method breaks with cells of type CO, CORO and TXT. When the user moves the mouse over the resulting dropdown list or textarea, it is treated as though the mouse has moved out of the grid, and the cell’s object disappears.

3. The LightMouseNavigation does not turn off when the User moves over the HEADER of the table. The top row of the grid remains hilighted.

My Question: Is there a function that I can call manually to “un-highlight” any rows, so that I can write a custom code to handle the requirements (1-3) above?



In “lightMouseSelection” mode - the row under mouse not just highlighted, but selected, so you can use only clearSelection to remove visual effect.

Technically you can
a) continue to use lightMouseSelection mode but with updated code
dhtmlxEvent(document.body,“mousemove”,function(){ if (!mygrid.editor) mygrid.clearSelection(); });


b) use row-hovering mode instead … 1217805000