3.2.0

Dynamic grid cell class assistance

I've seen a few examples of this, however I'm not getting results. I think it's an easy one. What's wrong with the following (shortened) example? The text "completed" would be one possible cell value for column 4.

<style>
.aw-state-completed {
   background:url("images/dash_completed.gif") no-repeat;
}
</style>

grid.defineCellProperty("state", function(col, row){
    if(col==4) { 
    return this.getCellText(col, row);
    }
});
    
grid.getColumnTemplate(4).setClass("state", function(){
   return this.getControlProperty("state");
});

}


Thanks in advance!
Curt K. :: California
April 8,
I guess it should be grid.getCellTemplate(4).setClass ....
Alex (ActiveWidgets)
April 8,
That would be yes, thank you!

Alex, are you in der Schweiz?
Curt K. :: California
April 8,
Yes, but not in the German-speaking part :-)
Alex (ActiveWidgets)
April 8,
Alex, one more on this topic. When I click on the cell as set above, the background goes away. What do I need to do? Tagging onto that question, how can I disable cell focus altogether?

Thank you.
Curt K. :: California
April 8,
Try using a different name for your property. The cell already has a 'state' property, which is updated on selection -

http://www.activewidgets.com/aw.ui.grid/cell-state.html
Alex (ActiveWidgets)
April 8,
Thank you. That solved the issue, and I found the answer to the second question also in the example. I can prevent cell focus by implementing the following:

grid.calculateCellState = function(i, j){
    this.setCellState("", i, j);
};


Curt K. :: California
April 8,
Sorry to drag this on, but now when I click on a cell and prevent the cell state from going into effect, the mouseover row color goes away until I re-mouseover. How could I force retention of the mouseover row color?

Things tried:

* I added "!important" to the css class.
* I removed the this.setCellState("", i, j) line.


Thank you in advance.
Curt K. :: California
April 8,

This topic is archived.

See also:


Back to support forum