oncellvalidated and background color
i am using this code to change the background color of the row when a cell edit is detected. The problem is that even though the row color is updated, the entire grid freezes. i'm still on v2 rc1.
grid2.onCellValidated = function(text, col, row){
try {
var template = this.getRowTemplate(row);
template.setStyle("background-color", "orange");
template.refresh();
} catch(e) {alert(e) }
}
Michael L
February 12,
i keep answering my own questions - bad.
grid2.onCellValidating = function(text, col, row){
try {
var template = this.getRowTemplate(row);
template.setStyle("background-color", "orange");
template.element().style.backgroundColor = "orange";
} catch(e) {alert(e) }
}
Michael L
February 12,
Michael,
there is currently (2.0) a bug in setStyle() method - if the style name contains "-" symbol it will not be immediately updated on screen. Your code would work fine if you use "background" instead of "background-color".
obj.onCellValidated = function(text, col, row){
var template = this.getRowTemplate(row);
template.setStyle("background", "orange");
}
Alex (ActiveWidgets)
February 13,
Thanks alex that worked.
I hope you can help me answer this question, does the grid support multiple cell selections? (not rows) - i need to be able to select a range of cells. If not is there a work around?
Michael L
February 13,
Well, and how to set the background image ? What parameter to pass ?
for example:
group.setStyle("background-image", "../AW/styles/aqua/bg1.png");
does not work...
Best Regards
ASJ
April 28,
I believe it is like this:
template.setStyle("background", "url(../AW/styles/aqua/bg1.png)");
John Mason
December 6,
I used this technique to change cell background when the color changed. The problem was that the selected cell highlighting stopped working (the white text worked, but the blue background failed). I found this other message with the solution:
Readd these styles with !important
.aw-cells-selected, .aw-rows-selected {
color: #fff!important;
background: #396FA2!important;
}
.aw-rows-selected .aw-grid-cell {
background: none!important;
}
I found the solution in this message from ASJ:
http://www.activewidgets.com/javascript.forum.13601.1/setting-backgroud-color-for-row.html
PeteR
July 2,