:: Forum >> Version 2 >>

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(colrow){
    if(
col==4) { 
    return 
this.getCellText(colrow);
    }
});
    
grid.getColumnTemplate(4).setClass("state", function(){
   return 
this.getControlProperty("state");
});

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

Alex, are you in der Schweiz?
Curt K. :: California
Wednesday, April 8, 2009
Yes, but not in the German-speaking part :-)
Alex (ActiveWidgets)
Wednesday, April 8, 2009
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
Wednesday, April 8, 2009
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)
Wednesday, April 8, 2009
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(ij){
    
this.setCellState(""ij);
};
 
Curt K. :: California
Wednesday, April 8, 2009
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
Wednesday, April 8, 2009



This topic is archived.

Back to support forum

Forum search