Changing RowColor on filtered GRID

Hello

I’m changing RowColor as follow:

Grid[1].attachEvent("onRowSelect", function(id,ind){
   if (ind == 14) { 
      Grid[1].cells(id, 17).setValue("1");
      Grid[1].setRowColor(id, "#99E597");
   }
});

So far … but when i use a header filter, colorizing does not work because ID is not the id of the new filtered GRID … it’s ID from the original one.

Where’s my mistake?

Thank you

Oliver

Hmm … i think i need to say that it’s not mainly important to change color of a column. I do this in a second step. I need to proof a row, and when everything is OK, i need to mark this as OK. I do this with a button inside the row.

You can use “this” in the event handlers, like

Grid[1].attachEvent("onRowSelect", function(id,ind){ if (ind == 14) { this.cells(id, 17).setValue("1"); this.setRowColor(id, "#99E597"); } });

It will be the grid instance, which have triggered the event.

OK … this works for me but if i use “setRowColor” the row is colorized but i don’t see the new color. I still see the color of “the selected row”. Is there any way to refresh the row?

I tried this with

if (ind == 14) {
   Grid[1].cells(id, 17).setValue("1");
   var farbe = "#99E597";
}
Grid[1].forEachCell(id, function(cellObj,cInd){				
   Grid[1].setCellTextStyle(Grid[1].getRowId(id-1),cInd,"background-color:"+farbe);   
});

which works great … but … if i try what you told me before Grid does not colorize:

if (ind == 14) {
   this.cells(id, 17).setValue("1");
   var farbe = "#99E597";
}
this.forEachCell(id, function(cellObj,cInd){				
   this.setCellTextStyle(this.getRowId(id-1),cInd,"background-color:"+farbe);   
});

Thank you

Color of selection has higher priority.
You can try to change the coloring command

this.setRowColor(id, “#99E597”);

like next

this.setRowTextStyle(id, “background: #99E597;”);

Perfekt … that was exactly what i was searching for.

Thank you :slight_smile: