Skip to content

Replies

0
Pree Khanna
Pree Khanna answered on Apr 29, 2016 8:37 AM

Thank you for the reply. 

I had solved the issue using below lines of code:

var gridId = evt.target.id;
var columnIndex;

if(gridId == "ProjNew_Index")
{
for(i = 62; i < ds.length; i++)
{
columnIndex = $("#" + gridId + "_" + "REASONS").data("columnIndex")-1;
$(grid.igGrid("cellAt", columnIndex, i)).css('background-color', 'gray');
}
}

Thank you

 

0
Pree Khanna
Pree Khanna answered on Apr 21, 2016 6:52 AM

Please suggest some solution. 

0
Pree Khanna
Pree Khanna answered on Apr 18, 2016 9:11 AM

Hi Tsanna,

Thank you for the reply. With your help and suggestion I am able to solve the issue.

Below lines of code worked for me:

var columnIndex;
columnIndex = $("#" + gridId + "_" + "col_Name").data("columnIndex");
$(grid.igGrid("cellAt", columnIndex, i)).css('background-color', 'gray');

Thank you so much for the help. 

 

0
Pree Khanna
Pree Khanna answered on Apr 13, 2016 9:42 AM

Hi Tsanna,

Please let me know what is "gridID_columnKey" in your code ? Do I have to append both gridID and ColumnKey and pass here or anything else that I am unable to understand ?

And when passing "gridID_columnKey", how am I getting the respective CELL here (for which i have to change the background color), as the current value is for Column not for Cell ? Please correct if my understanding is wrong.


Waiting for the reply. 

0
Pree Khanna
Pree Khanna answered on Apr 13, 2016 6:59 AM

Hi Tsanna,

I tried below javaScript code to achieve the desired requirement, in respective View(Index.cshtml):

function changeCellColor() {

debugger;
var gridId = evt.target.id; //getting gridId of respective controller
if(gridId!=null && gridId!=undefined)
{
var column = grid.igGrid("columnByKey","EXPD_HDR_VARIANCE_REASONS"); //getting column key

$(gridId).find("td[aria-describedby=" + column + "]").css("background-color", "red"); //code to change background color
}

}

In above code, I am able to get the gridId, columnKey but please let me know how to pass the specific cellKey to change specific CELL background color, in my above code ?
Also, when I am trying the same code to change the color of column(just to test the code) it never change the background color.

Please let me know what is wrong in my code ? 

Looking forward for the reply. Thanks in advance.
 

 

0
Pree Khanna
Pree Khanna answered on Apr 13, 2016 4:45 AM

Hi Tsanna,

Thank you for the reply. I am trying your suggested method. Will update you soon.