3.2.0

Setting backgroud-color for row overides selection color ?

WHat I mean...

I have this:

grid1.defineRowProperty("Mybackcolor", function(row){ 
        return this.getCellValue(7, row); 
        }); 
    grid1.getRowTemplate().setStyle("background-color", function(){ 
        return this.getRowProperty("Mybackcolor"); 
        });


to set custom colors for each row, but this way Selection color dissapeared. I mean, the text color works (getting white text) but the backgroud bolor does not change. That way I get White text on wery light row backgrounds making it impossible to read.

I tried to workaroud it by:

grid1.getRowTemplate().onControlActivated = function(event){
          return this.setStyle("background-color", '');
           
        }
    
    grid1.getRowTemplate().onControlDeactivated = function(event){
          return this.setStyle("background-color", "Mybackcolor"); 
        }


but it does not work :(

(Seemd to be much easier in v.1, or I just haven't found the way in v.2 :| )
ASJ
April 23,
OK, found the solution by adding styles on the page again with !important...

.aw-cells-selected, .aw-rows-selected {
    color: #fff!important;
    background: #396FA2!important;
}

.aw-rows-selected .aw-grid-cell {
    background: none!important;
}
ASJ
April 24,

This topic is archived.

See also:


Back to support forum