:: Forum >> Version 2 >>

java-neandertal missing the rowboat

More information on this topic is available in the documentation section: /active.howto.style.rows/alternate-background-colors.html.

First I'd like to say how sweet ActiveWidgets grid control is ;)

I seem to be a java-neandertal and for the life of me, I cant figure out what stupid little mistake I am making to prevent my row colors from working.. .

ASP code (modified activewidgets_grid, found in activewidgets.asp) :
====================================================
<script>
<% response.write columns & vbNewLine
response.write rows & vbNewLine %>
try {
var <% = name %>= new Active.Controls.Grid;
<% = name %>.setRowCount(<% = row_count %>);
<% = name %>.setColumnCount(<% = column_count %>);
<% = name %>.setDataText(function(i, j){return <% = name %>_data[i][j]});
<% = name %>.setColumnText(function(i){return <% = name %>_columns[i]});
var alternate = function(){
return this.getRowProperty("order") % 2 ? "#fffa0" : "#ffffff";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
<% = name %>.setTemplate("row", row);
document.write(obj);
}
catch (error){
document.write(error.description);
}
</script><%

=============================================
end ASP
Begin javascript output (less masive grid data)
=============================================
var obj_columns = [ *** omitted data ***];
var obj_data = [ *** omitted data ***];
try {
var obj= new Active.Controls.Grid;
obj.setRowCount(32);
obj.setColumnCount(17);
obj.setDataText(function(i, j){return obj_data[i][j]});
obj.setColumnText(function(i){return obj_columns[i]});
var alternate = function(){
return this.getRowProperty("order") % 2 ? "#fffa0" : "#ffffff";
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
obj.setTemplate("row", row);
document.write(obj);
}
catch (error){
document.write(error.description);
===================================================
end Javascript

the javascript runs with no errors, the talbe displays just fine, but no alternating row color?

Any help would be appriciated:)



Ron
Sunday, January 22, 2006
Gah! please... Doh! "#FFFA0"??? I cant believe it... oh well problem solved.. sorry for waisting bandwidth lol exaclty 2.5 bytes does not make for a very complete rgb color set.
Ron
Sunday, January 22, 2006



This topic is archived.

Back to /active.howto.style.rows/alternate-background-colors.html

Documentation:

Forum search