AW.HTML.NewGrid = AW.System.Control.subclass( );
AW.HTML.NewGrid.create = function( ){
var obj = this.prototype;
obj.defineTemplate( "test", new AW.UI.Grid );
with ( obj.getTemplate( "test" ) )
{
setSize( 300, 300 );
setPosition( 10,10 );
setSelectorVisible( true );
setSelectorText(function(i){return i});
setSelectorWidth( 200 );
setCellText( "test" );
setHeaderText( "header" );
setRowCount( 5 );
setColumnCount( 4 );
}
obj.setContent( "html", function( )
{
return this.getTestTemplate( );
} );
}
b = new AW.HTML.NewGrid;
document.write( b );
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<style> BODY { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; MARGIN: 0px; OVERFLOW: hidden; PADDING-TOP: 0px }
HTML { PADDING-RIGHT: 0px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 0px; OVERFLOW: hidden; PADDING-TOP: 0px }
</style>
<script src="../ActiveWidgets2B3Runtime/lib/aw.js"></script>
<link href="../ActiveWidgets2B3Runtime/styles/xp/aw.css" rel="stylesheet">
<style>
.aw-grid-control {height: 100%; width: 100%; margin: 0; border: none; font: menu; font-size: 12px; background-color: #E0DFE3}
.aw-column-0 {width: 125px; }
.aw-column-1 {width: 125px; }
.aw-column-2 {width: 125px; }
.aw-column-3 {width: 125px; }
.aw-column-4 {width: 125px; }
.aw-column-5 {width: 125px; }
.aw-column-6 {width: 125px; }
.aw-column-7 {width: 125px; }
.aw-column-8 {width: 125px; }
.aw-column-9 {width: 125px; }
.aw-column-10 {width: 125px; }
.aw-grid-headers {color: blue;}
.aw-grid-row {height: 50px;}
.aw-grid-cell {border-right: 1px solid threedlightshadow;}
.aw-grid-row {border-bottom: 1px solid threedlightshadow;}
.aw-rows-selected {background: #316ac5;}
.aw-mouseover-row .aw-row-selector {color: red;}
</style>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form name="Form1" method="post" action="WebForm1.aspx" id="Form1">
<input type="hidden" name="__VIEWSTATE" value="dDwtNjU0MzcyMTk1Ozs+AwMt47BFHvyyl1Qvo9HyEuuWXWQ=" />
<center><div class="scrollTable" id="testScrollTable" style="overflow: auto; height: 450; width: 900;"><script>
var myData = [["RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>8/20/2005<BR>7:08 PM","Unconfigured<BR>8/16/2005<BR>10:00 PM","Unconfigured<BR>NEVER","Unconfigured<BR>10/11/2005<BR>4:05 PM","Unconfigured<BR>10/13/2005<BR>4:13 PM","DDI<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>10/11/2005<BR>4:43 PM"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>NEVER","Unconfigured<BR>8/20/2005<BR>7:08 PM","Unconfigured<BR>9/16/2005<BR>6:33 PM","Unconfigured<BR>9/15/2005<BR>1:06 PM","DDI<BR>10/18/2005<BR>7:47 PM","Unconfigured<BR>9/24/2005<BR>6:14 PM","DDI<BR>10/17/2005<BR>8:37 PM","Unconfigured<BR>9/29/2005<BR>4:34 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>9/29/2005<BR>4:34 PM"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>11/29/2005<BR>2:28 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","DDI<BR>11/29/2005<BR>2:49 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","DDI<BR>11/4/2005<BR>11:28 AM","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","DDI<BR>11/4/2005<BR>11:22 AM"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","DDI<BR>12/8/2005<BR>11:25 AM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","DDI<BR>12/8/2005<BR>11:32 AM","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>12/8/2005<BR>11:26 AM","Unconfigured<BR>NEVER"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>NEVER","DDI<BR>11/9/2005<BR>2:02 PM","Unconfigured<BR>NEVER","DDI<BR>11/9/2005<BR>10:16 AM","DDI<BR>11/18/2005<BR>10:17 AM","Unconfigured<BR>NEVER","DDI<BR>11/9/2005<BR>11:09 AM","DDI<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>11/9/2005<BR>4:14 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>NEVER","DDI<BR>11/9/2005<BR>2:02 PM","Unconfigured<BR>NEVER","DDI<BR>11/9/2005<BR>10:16 AM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","DDI<BR>11/9/2005<BR>11:09 AM","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>11/9/2005<BR>3:33 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","DDI<BR>12/7/2005<BR>10:31 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","DDI<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","RSS Manager<BR>12/20/2005<BR>2:30 PM","DDI<BR>12/7/2005<BR>11:14 PM","DDI<BR>12/19/2005<BR>10:01 PM"],["RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","RSS Manager<BR>12/20/2005<BR>2:30 PM","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER"],["Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER","Unconfigured<BR>NEVER"]];
var myColumns = ["7DayWeather","Announcements","BusinessNews","EntertainmentNews","Events","LocalNews","NationalNews","ReplacementImages","SportsNews","Stocks","Weather","WhateverNews","WorldNews"];
var myRows = ["Charlotte1","Charlotte2","Gateway","IJL","ImageBuilder","Phil's Group","Phil2","RHG","rhgtesting","Test Group 2"];
var obj = new AW.UI.Grid;
obj.getRowTemplate().setClass("text", "wrap");
obj.setRowCount(10);
obj.setColumnCount(13);
obj.setCellText(myData);
obj.setHeaderHeight("30");
obj.setHeaderText(myColumns);
obj.getHeadersTemplate().setClass("text", "wrap");
obj.setSelectorVisible(true);
obj.setSelectorText(myRows);
obj.setSelectorWidth("120");
obj.setSelectionMode("single-cell");
obj.setCellEditable(false);
obj.defineCellProperty("color", function(col,row){
debugger
var value = this.getCellText(col,row);
var color = "black";
if (value.indexOf("NEVER") > 0){
color = "red";
}
else{
var today=new Date();
var index=value.indexOf("<BR>")+4;
var datepart=value.substring(index);
datepart = datepart.replace("<BR>", " ");
var then=new Date(datepart);
var hours=Math.ceil((((today.getTime()-then.getTime())/1000)/60)/60);
if (hours>24){
color="orange";
}
else if (hours>12){
color="blue";
}
}
return color;
});
obj.getCellTemplate().setStyle("color", function(){return this.getControlProperty("color"); });
obj.onCellClicked = function(event, column, row){ window.status = "Cell " + column + "." + row + " clicked"};
document.write(obj);
</script></div></center>
</form>
</body>
</HTML>
This topic is archived.