var table = new Active.XML.Table;
table.setURL(get_xml_url("list"));
table.request();
var columns = ["Person", "Address"];
if(gid('state_id').value == 1)
columns = ["State"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
obj.setColumnProperty("texts", columns);
obj.setDataModel(table);
var alternate = function(){
return this.getProperty("row/order") % 2 ? "#fcfaf6" : "#ffffff";
}
var mark = function(){
var i = this.getProperty("row/index");
return (i==2 || i==4 || i==5) ? true : false;
}
var row = new Active.Templates.Row;
row.setStyle("background", alternate);
row.setClass("mark", mark);
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setTemplate("row", row);
obj.setAction("click", function(src){alert('A');});
window.setTimeout(function(){
try {
document.getElementById("stuff").innerHTML = obj;
}
catch(e){
}
}, 100);
// document.write(obj);
}
catch(e){
}
}
<style>
.active-controls-grid {height: 420px; font: menu;}
.active-column-0 {width: 100px;}
.active-column-1 {width: 200px; }
.active-grid-column {border-right: 1px solid threedlightshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
.active-templates-row.gecko {
display: -moz-box;
width: auto;
min-width: 100%;
}
.active-row-highlight {background-color: #ddeeff!important}
.active-row-highlight .active-row-cell {background-color: #ddeeff;}
.active-mark-true .active-column-2 {color: #f00}
</style>
This topic is archived.