3.2.0

Cell-selected style

Hi,

does anyone know a solution for the following?

I need to highlight differently the selected cells of column 0 from the others.

I have thought something like this but it doesn't work:

<style>
    .aw-grid-control {height: 400px; width:400px; background: #EEE8AA;} 
    .aw-column-0 {background-color: #0000FF;} // frozen column
    .aw-column-0 .aw-cells-selected  {color: #FF8000;}  ???????
</style>


Thanks
MP
April 21,
The aw-column-0 and the .aw-cells-selected classes are actually on the same span element. So try eliminating the space to require that the rule is applied if the span has both class names:

.aw-column-0.aw-cells-selected {color: red;}

Notice no space betwen "0" and "."

Unfortunately this is only working on firefox for me.

Dave T
April 21,
Yes, correct. Unfortunately IE does not understand CSS selectors like .class1.class2 (logical AND).

The only solution is to put your class inside the cell. The ImageText template is made of two nested spans, inner one marked as 'box', so if you assign some class to this inner box - you can use .class1 .class2 (inside).

<style>

.aw-cells-selected .aw-special-cell {background:red}

</style>
<script>

    var obj = new AW.UI.Grid;
    obj.setCellData("cell");
    obj.setHeaderText("header");

    var specialCell = new AW.Templates.ImageText;
    specialCell.getContent("box").setClass("special", "cell");

    obj.setCellTemplate(specialCell, 0)

    obj.setColumnCount(10);
    obj.setRowCount(10);

    document.write(obj);

</script>
Alex (ActiveWidgets)
April 21,
Alex, why doesn't think work:?

.aw-cells-selected {color: expression(grid.getCurrentColumn()==0?'red':'yellow' );}

It seems that the .aw-cells-selected class name does not get removed.
Dave T
April 21,

This topic is archived.

See also:


Back to support forum