I am trying to highlight the current cell in a radGrid while mouseover is happening. For the most part I have it figured out, except for getting the initial background cell color before changing it, so I can change it back on the mouseout event.
Here is my JS. The row that is not giving me what I need is $LastColor = item.get_cell(cellName).style.background; It is returning white when it should be getting the cell background color. What is the correct property to get this?
Here is my JS. The row that is not giving me what I need is $LastColor = item.get_cell(cellName).style.background; It is returning white when it should be getting the cell background color. What is the correct property to get this?
var $LastColor
function RowMouseOver(sender, eventArgs) {
var rowIndex = eventArgs.get_itemIndexHierarchical();
var item = sender.get_masterTableView().get_dataItems()[rowIndex];
var cellIndex = eventArgs._domEvent.target.cellIndex;
var cellName = $find('<%= rgProjectDetails.ClientID%>').get_masterTableView().get_columns()[cellIndex].get_uniqueName();
$LastColor = item.get_cell(cellName).style.background;
item.get_cell(cellName).style.background = "red";
}
function RowMouseOut(sender, eventArgs) {
var rowIndex = eventArgs.get_itemIndexHierarchical();
var item = sender.get_masterTableView().get_dataItems()[rowIndex];
var cellIndex = eventArgs._domEvent.target.cellIndex;
var cellName = $find('<%= rgProjectDetails.ClientID%>').get_masterTableView().get_columns()[cellIndex].get_uniqueName();
item.get_cell(cellName).style.background = $LastColor;
}