asset manager initial check in

This commit is contained in:
JT Smith 2004-12-17 05:38:46 +00:00
parent 4bc4974ecc
commit f7dd3b0577
320 changed files with 15398 additions and 0 deletions

View file

@ -0,0 +1,69 @@
<%
function activewidgets_grid(name, oRecordset)
Dim i, columns, rows, s
Dim column_count, row_count
column_count = oRecordset.fields.count
columns = "var " & name & "_columns = [" & vbNewLine
For i=0 to (column_count-1)
columns = columns & """" & activewidgets_html(oRecordset(i).name) & """, "
Next
columns = columns & vbNewLine & "];" & vbNewLine
row_count = 0
rows = "var " & name & "_data = [" & vbNewLine
Do while (Not oRecordset.eof)
row_count = row_count + 1
rows = rows & "["
For i=0 to (column_count-1)
rows = rows & """" & activewidgets_html(oRecordset(i)) & """, "
Next
rows = rows & "]," & vbNewLine
oRecordset.MoveNext
Loop
rows = rows & "];" & vbNewLine
s = vbNewLine
s = s & "<" & "script" & ">" & vbNewLine
s = s & columns & vbNewLine
s = s & rows & vbNewLine
s = s & "try {" & vbNewLine
s = s & " var " & name & "= new Active.Controls.Grid;" & vbNewLine
s = s & " " & name & ".setRowCount(" & row_count & ");" & vbNewLine
s = s & " " & name & ".setColumnCount(" & column_count & ");" & vbNewLine
s = s & " " & name & ".setDataText(function(i, j){return " & name & "_data[i][j]});" & vbNewLine
s = s & " " & name & ".setColumnText(function(i){return " & name & "_columns[i]});" & vbNewLine
s = s & " document.write(" & name & ");" & vbNewLine
s = s & "}" & vbNewLine
s = s & "catch (error){" & vbNewLine
s = s & " document.write(error.description);" & vbNewLine
s = s & "}" & vbNewLine
s = s & "</" & "script" & ">" & vbNewLine
activewidgets_grid = s
end function
function activewidgets_html(s)
s = Replace(s, "\", "\\")
s = Replace(s, """", "\""")
s = Replace(s, vbCr, "\r")
s = Replace(s, vbLf, "\n")
activewidgets_html = s
end function
%>

View file

@ -0,0 +1,37 @@
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
<html>
<head>
<title>ActiveWidgets Grid :: ASP Example</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;font: menu;border: none;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- ActiveWidgets ASP functions -->
<!-- #INCLUDE FILE="activewidgets.asp" -->
</head>
<body>
<%
Dim oConnection
Dim oRecordset
' Create ADO Connection
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database.mdb")
' Execute a SQL query
Set oRecordset = oConnection.Execute("SELECT * FROM authors")
' Write grid to the page
Response.write(activewidgets_grid("obj", oRecordset))
' Close recordset and connection
oRecordset.close
oConnection.close
%>
</body>
</html>

View file

@ -0,0 +1,43 @@
<?xml version="1.0"?>
<ArrayOfCompany xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
<company>
<ticker>MSFT</ticker>
<name>Microsoft Corporation</name>
<marketcap>314571.156</marketcap>
<sales>32187</sales>
<employees>55000</employees>
<timestamp>2003-11-30T22:50:20.5945552+01:00</timestamp>
</company>
<company>
<ticker>ORCL</ticker>
<name>Oracle Corporation</name>
<marketcap>62615.27</marketcap>
<sales>9519</sales>
<employees>40650</employees>
<timestamp>2003-11-30T22:50:20.5945552+01:00</timestamp>
</company>
<company>
<ticker>SAP</ticker>
<name>SAP AG (ADR)</name>
<marketcap>40986.33</marketcap>
<sales>8296.42</sales>
<employees>28961</employees>
<timestamp>2003-11-30T22:50:20.5945552+01:00</timestamp>
</company>
<company>
<ticker>CA</ticker>
<name>Computer Associates Inter</name>
<marketcap>15606.34</marketcap>
<sales>3164</sales>
<employees>16000</employees>
<timestamp>2003-11-30T22:50:20.5945552+01:00</timestamp>
</company>
<company>
<ticker>ERTS</ticker>
<name>Electronic Arts Inc.</name>
<marketcap>14490.9</marketcap>
<sales>2503.73</sales>
<employees>4000</employees>
<timestamp>2003-11-30T22:50:20.5945552+01:00</timestamp>
</company>
</ArrayOfCompany>

View file

@ -0,0 +1,67 @@
<?xml version="1.0"?>
<DataSet xmlns="http://tempuri.org/">
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="ticker" type="xs:string" minOccurs="0" />
<xs:element name="name" type="xs:string" minOccurs="0" />
<xs:element name="mktcap" type="xs:double" minOccurs="0" />
<xs:element name="sales" type="xs:double" minOccurs="0" />
<xs:element name="employees" type="xs:double" minOccurs="0" />
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<ticker>MSFT</ticker>
<name>Microsoft Corporation</name>
<mktcap>314571.16</mktcap>
<sales>32187</sales>
<employees>55000</employees>
<timestamp>2003-11-27T00:00:00.0000000+01:00</timestamp>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<ticker>ORCL</ticker>
<name>Oracle Corporation</name>
<mktcap>62615.27</mktcap>
<sales>9519</sales>
<employees>40650</employees>
<timestamp>2003-11-27T00:00:00.0000000+01:00</timestamp>
</Table>
<Table diffgr:id="Table3" msdata:rowOrder="2">
<ticker>SAP</ticker>
<name>SAP AG (ADR)</name>
<mktcap>40986.33</mktcap>
<sales>8296.42</sales>
<employees>28961</employees>
<timestamp>2003-11-27T00:00:00.0000000+01:00</timestamp>
</Table>
<Table diffgr:id="Table4" msdata:rowOrder="3">
<ticker>CA</ticker>
<name>Computer Associates Inter</name>
<mktcap>15606.34</mktcap>
<sales>3164</sales>
<employees>16000</employees>
<timestamp>2003-11-27T00:00:00.0000000+01:00</timestamp>
</Table>
<Table diffgr:id="Table5" msdata:rowOrder="4">
<ticker>ERTS</ticker>
<name>Electronic Arts Inc.</name>
<mktcap>14490.9</mktcap>
<sales>2503.73</sales>
<employees>4000</employees>
<timestamp>2003-11-27T00:00:00.0000000+01:00</timestamp>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataSet>

View file

@ -0,0 +1,142 @@
<companies>
<company>
<ticker>MSFT</ticker>
<name>Microsoft Corporation</name>
<mktcap>314,571.156</mktcap>
<sales>32,187.000</sales>
<employees>55000</employees>
</company>
<company>
<ticker>ORCL</ticker>
<name>Oracle Corporation</name>
<mktcap>62,615.266</mktcap>
<sales>9,519.000</sales>
<employees>40650</employees>
</company>
<company>
<ticker>SAP</ticker>
<name>SAP AG (ADR)</name>
<mktcap>40,986.328</mktcap>
<sales>8,296.420</sales>
<employees>28961</employees>
</company>
<company>
<ticker>CA</ticker>
<name>Computer Associates Inter</name>
<mktcap>15,606.335</mktcap>
<sales>3,164.000</sales>
<employees>16000</employees>
</company>
<company>
<ticker>ERTS</ticker>
<name>Electronic Arts Inc.</name>
<mktcap>14,490.895</mktcap>
<sales>2,503.727</sales>
<employees>4000</employees>
</company>
<company>
<ticker>SFTBF</ticker>
<name>Softbank Corp. (ADR)</name>
<mktcap>14,485.840</mktcap>
<sales>.000</sales>
<employees>6865</employees>
</company>
<company>
<ticker>VRTS</ticker>
<name>Veritas Software Corp.</name>
<mktcap>14,444.272</mktcap>
<sales>1,578.658</sales>
<employees>5647</employees>
</company>
<company>
<ticker>SYMC</ticker>
<name>Symantec Corporation</name>
<mktcap>9,932.483</mktcap>
<sales>1,482.029</sales>
<employees>4300</employees>
</company>
<company>
<ticker>INFY</ticker>
<name>Infosys Technologies Ltd.</name>
<mktcap>9,763.851</mktcap>
<sales>830.748</sales>
<employees>15400</employees>
</company>
<company>
<ticker>INTU</ticker>
<name>Intuit Inc.</name>
<mktcap>9,702.477</mktcap>
<sales>1,650.743</sales>
<employees>6700</employees>
</company>
<company>
<ticker>ADBE</ticker>
<name>Adobe Systems Incorporate</name>
<mktcap>9,533.050</mktcap>
<sales>1,230.817</sales>
<employees>3341</employees>
</company>
<company>
<ticker>PSFT</ticker>
<name>PeopleSoft, Inc.</name>
<mktcap>8,246.467</mktcap>
<sales>1,941.167</sales>
<employees>8180</employees>
</company>
<company>
<ticker>SEBL</ticker>
<name>Siebel Systems, Inc.</name>
<mktcap>5,434.649</mktcap>
<sales>1,417.952</sales>
<employees>5909</employees>
</company>
<company>
<ticker>BEAS</ticker>
<name>BEA Systems, Inc.</name>
<mktcap>5,111.813</mktcap>
<sales>965.694</sales>
<employees>3063</employees>
</company>
<company>
<ticker>SNPS</ticker>
<name>Synopsys, Inc.</name>
<mktcap>4,482.535</mktcap>
<sales>1,169.786</sales>
<employees>4254</employees>
</company>
<company>
<ticker>CHKP</ticker>
<name>Check Point Software Tech</name>
<mktcap>4,396.853</mktcap>
<sales>424.769</sales>
<employees>1203</employees>
</company>
<company>
<ticker>MERQ</ticker>
<name>Mercury Interactive Corp.</name>
<mktcap>4,325.488</mktcap>
<sales>444.063</sales>
<employees>1822</employees>
</company>
<company>
<ticker>DOX</ticker>
<name>Amdocs Limited</name>
<mktcap>4,288.017</mktcap>
<sales>1,427.088</sales>
<employees>9400</employees>
</company>
<company>
<ticker>CTXS</ticker>
<name>Citrix Systems, Inc.</name>
<mktcap>3,946.485</mktcap>
<sales>554.222</sales>
<employees>1670</employees>
</company>
<company>
<ticker>KNM</ticker>
<name>Konami Corporation (ADR)</name>
<mktcap>3,710.784</mktcap>
<sales>.000</sales>
<employees>4313</employees>
</company>
</companies>

View file

@ -0,0 +1,20 @@
MSFT,"Microsoft Corporation","314,571.16","32,187.00",55000
ORCL,Oracle Corporation,"62,615.27","9,519.00",40650
SAP,SAP AG (ADR),"40,986.33","8,296.42",28961
CA,Computer Associates Inter,"15,606.34","3,164.00",16000
ERTS,Electronic Arts Inc.,"14,490.90","2,503.73",4000
SFTBF,Softbank Corp. (ADR),"14,485.84",0,6865
VRTS,Veritas Software Corp.,"14,444.27","1,578.66",5647
SYMC,Symantec Corporation,"9,932.48","1,482.03",4300
INFY,Infosys Technologies Ltd.,"9,763.85",830.748,15400
INTU,Intuit Inc.,"9,702.48","1,650.74",6700
ADBE,Adobe Systems Incorporate,"9,533.05","1,230.82",3341
PSFT,"PeopleSoft, Inc.","8,246.47","1,941.17",8180
SEBL,"Siebel Systems, Inc.","5,434.65","1,417.95",5909
BEAS,"BEA Systems, Inc.","5,111.81",965.694,3063
SNPS,"Synopsys, Inc.","4,482.54","1,169.79",4254
CHKP,Check Point Software Tech,"4,396.85",424.769,1203
MERQ,Mercury Interactive Corp.,"4,325.49",444.063,1822
DOX,Amdocs Limited,"4,288.02","1,427.09",9400
CTXS,"Citrix Systems, Inc.","3,946.49",554.222,1670
KNM,Konami Corporation (ADR),"3,710.78",0,4313
1 MSFT Microsoft Corporation 314,571.16 32,187.00 55000
2 ORCL Oracle Corporation 62,615.27 9,519.00 40650
3 SAP SAP AG (ADR) 40,986.33 8,296.42 28961
4 CA Computer Associates Inter 15,606.34 3,164.00 16000
5 ERTS Electronic Arts Inc. 14,490.90 2,503.73 4000
6 SFTBF Softbank Corp. (ADR) 14,485.84 0 6865
7 VRTS Veritas Software Corp. 14,444.27 1,578.66 5647
8 SYMC Symantec Corporation 9,932.48 1,482.03 4300
9 INFY Infosys Technologies Ltd. 9,763.85 830.748 15400
10 INTU Intuit Inc. 9,702.48 1,650.74 6700
11 ADBE Adobe Systems Incorporate 9,533.05 1,230.82 3341
12 PSFT PeopleSoft, Inc. 8,246.47 1,941.17 8180
13 SEBL Siebel Systems, Inc. 5,434.65 1,417.95 5909
14 BEAS BEA Systems, Inc. 5,111.81 965.694 3063
15 SNPS Synopsys, Inc. 4,482.54 1,169.79 4254
16 CHKP Check Point Software Tech 4,396.85 424.769 1203
17 MERQ Mercury Interactive Corp. 4,325.49 444.063 1822
18 DOX Amdocs Limited 4,288.02 1,427.09 9400
19 CTXS Citrix Systems, Inc. 3,946.49 554.222 1670
20 KNM Konami Corporation (ADR) 3,710.78 0 4313

View file

@ -0,0 +1,28 @@
var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
];
var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];

View file

@ -0,0 +1,20 @@
MSFT Microsoft Corporation "314,571.16" "32,187.00" 55000
ORCL Oracle Corporation "62,615.27" "9,519.00" 40650
SAP SAP AG (ADR) "40,986.33" "8,296.42" 28961
CA Computer Associates Inter "15,606.34" "3,164.00" 16000
ERTS Electronic Arts Inc. "14,490.90" "2,503.73" 4000
SFTBF Softbank Corp. (ADR) "14,485.84" 0 6865
VRTS Veritas Software Corp. "14,444.27" "1,578.66" 5647
SYMC Symantec Corporation "9,932.48" "1,482.03" 4300
INFY Infosys Technologies Ltd. "9,763.85" 830.748 15400
INTU Intuit Inc. "9,702.48" "1,650.74" 6700
ADBE Adobe Systems Incorporate "9,533.05" "1,230.82" 3341
PSFT "PeopleSoft, Inc." "8,246.47" "1,941.17" 8180
SEBL "Siebel Systems, Inc." "5,434.65" "1,417.95" 5909
BEAS "BEA Systems, Inc." "5,111.81" 965.694 3063
SNPS "Synopsys, Inc." "4,482.54" "1,169.79" 4254
CHKP Check Point Software Tech "4,396.85" 424.769 1203
MERQ Mercury Interactive Corp. "4,325.49" 444.063 1822
DOX Amdocs Limited "4,288.02" "1,427.09" 9400
CTXS "Citrix Systems, Inc." "3,946.49" 554.222 1670
KNM Konami Corporation (ADR) "3,710.78" 0 4313

View file

@ -0,0 +1,13 @@
var myData = [
["Features and benefits.doc", "97KB", "Microsoft Word Document", "27-Feb-03 16:53", "doc"],
["Readme.txt", "2KB", "Text Document", "12-Apr-03 10:21", "txt"],
["Web Services - White Paper.pdf", "101KB", "Adobe Acrobat Document", "15-Dec-02 22:10", "pdf"],
["Expense report.xls", "48KB", "Microsoft Excel Spreadsheet", "18-Oct-03 11:55", "xls"],
["Price history - MSFT, daily.xml", "580KB", "XML Document", "29-Nov-02 19:31", "xml"],
["WebMatrix.msi", "1,339KB", "Windows Installer Package", "9-Aug-03 15:06", "msi"],
["License.txt", "3KB", "Text Document", "19-Sep-02 22:29", "txt"],
["index.htm", "6KB", "HTML Document", "6-Nov-03 23:55", "htm"],
["xpmsgr.chm", "72KB", "Compiled HTML Help file", "12-Jul-02 5:00", "chm"]
];

View file

@ -0,0 +1,63 @@
<%@ WebService language="VB" class="grid" %>
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization
Imports Microsoft.VisualBasic
public class company
public ticker as string
public name as string
public marketcap as double
public sales as double
public employees as double
public timestamp as date
end Class
<WebService(Namespace:="http://tempuri.org/")> Public Class grid
<WebMethod> Public Function getCompanies() As company()
Dim r(4) as company
r(0) = new company
r(0).ticker = "MSFT"
r(0).name = "Microsoft Corporation"
r(0).marketCap = 314571.156
r(0).sales = 32187.000
r(0).employees = 55000
r(0).timestamp = Now
r(1) = new company
r(1).ticker = "ORCL"
r(1).name = "Oracle Corporation"
r(1).marketcap = 62615.27
r(1).sales = 9519.00
r(1).employees = 40650
r(1).timestamp = Now
r(2) = new company
r(2).ticker = "SAP"
r(2).name = "SAP AG (ADR)"
r(2).marketcap = 40986.33
r(2).sales = 8296.42
r(2).employees = 28961
r(2).timestamp = Now
r(3) = new company
r(3).ticker = "CA"
r(3).name = "Computer Associates Inter"
r(3).marketcap = 15606.34
r(3).sales = 3164.00
r(3).employees = 16000
r(3).timestamp = Now
r(4) = new company
r(4).ticker = "ERTS"
r(4).name = "Electronic Arts Inc."
r(4).marketcap = 14490.90
r(4).sales = 2503.73
r(4).employees = 4000
r(4).timestamp = Now
Return r
End Function
End Class

View file

@ -0,0 +1,80 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../source/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedlightshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
<!-- grid data -->
<script>
var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
];
var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
</script>
</head>
<body>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set number of rows/columns
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
// set headers width/height
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
// set click action handler
obj.setAction("click", function(src){window.status = src.getItemProperty("text")});
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,89 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
<!-- grid data -->
<script>
var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
];
var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
</script>
</head>
<body>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set number of rows/columns
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
// set headers width/height
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
// set click action handler
obj.setAction("click", function(src){window.status = src.getItemProperty("text")});
function myColor(){
var value = this.getItemProperty("value");
return value > 10000 ? "red" : "blue";
}
obj.getColumnTemplate(4).setStyle("color", myColor);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,53 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create ActiveWidgets data model - text-based table
var table = new Active.Text.Table;
// provide data URL - plain text comma-separated file
table.setURL("../data/companies.csv");
// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,53 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create ActiveWidgets data model - text-based table
var table = new Active.Text.Table;
// provide data URL - plain text tabs-separated file
table.setURL("../data/companies.txt");
// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,64 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 80px; text-align: right; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: right;}
.active-column-6 {text-align: right;}
.active-column-7 {text-align: right;}
.active-column-8 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create ActiveWidgets data model - text-based table
var table = new Active.Text.Table;
// Yahoo provides 15min delayed stock quotes in CSV format
var url = "http://finance.yahoo.com/d/quotes.csv?s=" +
"MSFT,ORCL,SAP,CA,ERTS,SFTBF,VRTS,SYMC,INFY,INTU,ADBE,PSFT,SEBL,BEAS,SNPS,CHKP,MERQ,DOX,CTXS,KNM" +
"&f=sl1d1t1c1ohgv&e=.csv";
// set data URL
table.setURL(url);
// start asyncronous data retrieval
table.request();
// define column labels
var columnNames = ["Ticker", "Last", "Date", "Time", "Change", "Close", "Open", "High", "Volume"];
var columnOrder = [0, 1, 4, 8, 3, 2, 5, 6, 7];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columnNames);
obj.setColumnProperty("values", columnOrder);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,56 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 200px;}
.active-column-1 {width: 80px; text-align: right;}
.active-column-2 {width: 150px;}
.active-column-3 {width: 120px;}
.active-box-image {height: 16px;} /* for firefox 0.8 */
</style>
<!-- grid data -->
<script src="../data/files.js"></script>
</head>
<body>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set the first column template to image+text
obj.setColumnTemplate(new Active.Templates.Image, 0);
// set number of rows/columns
obj.setRowProperty("count", 9);
obj.setColumnProperty("count", 4);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setDataProperty("image", function(i, j){return myData[i][4]});
// provide column headers
obj.setColumnProperty("texts" , ["Name", "Size", "Type", "Date Modified"]);
// set column/row headers width/height
obj.setColumnHeaderHeight("20px");
obj.setRowHeaderWidth("0px");
// add tooltips to the first column template and data model
obj.getColumnTemplate(0).setAttribute("title", function(){return this.getItemProperty("tooltip")});
obj.defineDataProperty("tooltip", function(i, j){return "Type: " + myData[i][2] + "\nDate Modified: " + myData[i][3] + "\nSize: " + myData[i][1]});
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,91 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
<!-- grid data -->
<script>
var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"]
];
var myColumns = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
</script>
</head>
<body>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set number of rows/columns
obj.setRowProperty("count", 20);
obj.setColumnProperty("count", 5);
// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});
// set headers width/height
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");
// allow multiple selection
obj.setSelectionProperty("multiple", true);
// define action handler
var message = function(){
window.status = "Grid selection:" +
" latest=" + this.getSelectionProperty("index") +
" full list=" + this.getSelectionProperty("values") +
" (press Ctrl- to select multiple rows)."
}
// assign action handler to grid
obj.setAction("selectionChanged", message);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden; font:menu} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
</head>
<body>
<script>
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// set data
obj.setRowProperty("count", 5);
obj.setColumnProperty("count", 5);
obj.setDataProperty("text", function(i, j){return i + "." + j});
// set column header tooltip
obj.setColumnProperty("tooltip", function(i){return "Tooltip for column " + i});
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,93 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {font: menu; background: threedface;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
#grid1 {height: 200px; border: 2px inset; background: white}
#grid2 {height: 100px; border: 2px inset; background: white}
#grid1 .active-column-1 {width: 200px; background-color: threedlightshadow;}
#grid2 .active-column-1 {width: 150px; background-color: infobackground;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
.active-grid-column {border-right: 1px solid threedlightshadow;}
</style>
<!-- grid data -->
<script>
var data1 = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
["SYMC", "Symantec Corporation", "9,932.483", "1,482.029", "4300"],
["INFY", "Infosys Technologies Ltd.", "9,763.851", "830.748", "15400"],
["INTU", "Intuit Inc.", "9,702.477", "1,650.743", "6700"],
["ADBE", "Adobe Systems Incorporate", "9,533.050", "1,230.817", "3341"],
["PSFT", "PeopleSoft, Inc.", "8,246.467", "1,941.167", "8180"],
["SEBL", "Siebel Systems, Inc.", "5,434.649", "1,417.952", "5909"],
["BEAS", "BEA Systems, Inc.", "5,111.813", "965.694", "3063"],
["SNPS", "Synopsys, Inc.", "4,482.535", "1,169.786", "4254"],
];
var data2 = [
["CHKP", "Check Point Software Tech", "4,396.853", "424.769", "1203"],
["MERQ", "Mercury Interactive Corp.", "4,325.488", "444.063", "1822"],
["DOX", "Amdocs Limited", "4,288.017", "1,427.088", "9400"],
["CTXS", "Citrix Systems, Inc.", "3,946.485", "554.222", "1670"],
["KNM", "Konami Corporation (ADR)", "3,710.784", ".000", "4313"],
];
var columns1 = [
"Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"
];
var columns2 = [
"Ticker(2)", "Company Name(2)", "Market Cap.(2)", "$ Sales(2)", "Employees(2)"
];
</script>
</head>
<body>
<p>
Here is the first grid:
</p>
<script>
var obj1 = new Active.Controls.Grid;
obj1.setId("grid1");
obj1.setRowProperty("count", 15);
obj1.setColumnProperty("count", 5);
obj1.setDataProperty("text", function(i, j){return data1[i][j]});
obj1.setColumnProperty("text", function(i){return columns1[i]});
document.write(obj1);
</script>
<p>
And another one...
</p>
<script>
var obj2 = new Active.Controls.Grid;
obj2.setId("grid2");
obj2.setRowProperty("count", 5);
obj2.setColumnProperty("count", 5);
obj2.setDataProperty("text", function(i, j){return data2[i][j]});
obj2.setColumnProperty("text", function(i){return columns2[i]});
document.write(obj2);
</script>
</body>
</html>

View file

@ -0,0 +1,76 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create data formats
var string = new Active.Formats.String;
var number1 = new Active.Formats.Number;
var number2 = new Active.Formats.Number;
var date = new Active.Formats.Date;
// define formatting rule for text output
number1.setTextFormat("#,###.##");
number2.setTextFormat("");
date.setTextFormat("dd mmm yy");
date.setDataFormat("ISO8061");
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// provide data URL
table.setURL("../data/companies-array.xml");
// define namespace for selecting column data
table.setNamespace("co", "http://tempuri.org/");
// set column XPath
table.setColumns(["co:ticker", "co:name", "co:marketcap", "co:sales", "co:employees", "co:timestamp"]);
// set column formatting
table.setFormats([string, string, number1, number1, number2, date]);
// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees", "Date"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,207 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<xml id="xmlDataIsland">
<companies>
<company>
<ticker>MSFT</ticker>
<name>Microsoft Corporation</name>
<mktcap>314,571.156</mktcap>
<sales>32,187.000</sales>
<employees>55000</employees>
</company>
<company>
<ticker>ORCL</ticker>
<name>Oracle Corporation</name>
<mktcap>62,615.266</mktcap>
<sales>9,519.000</sales>
<employees>40650</employees>
</company>
<company>
<ticker>SAP</ticker>
<name>SAP AG (ADR)</name>
<mktcap>40,986.328</mktcap>
<sales>8,296.420</sales>
<employees>28961</employees>
</company>
<company>
<ticker>CA</ticker>
<name>Computer Associates Inter</name>
<mktcap>15,606.335</mktcap>
<sales>3,164.000</sales>
<employees>16000</employees>
</company>
<company>
<ticker>ERTS</ticker>
<name>Electronic Arts Inc.</name>
<mktcap>14,490.895</mktcap>
<sales>2,503.727</sales>
<employees>4000</employees>
</company>
<company>
<ticker>SFTBF</ticker>
<name>Softbank Corp. (ADR)</name>
<mktcap>14,485.840</mktcap>
<sales>.000</sales>
<employees>6865</employees>
</company>
<company>
<ticker>VRTS</ticker>
<name>Veritas Software Corp.</name>
<mktcap>14,444.272</mktcap>
<sales>1,578.658</sales>
<employees>5647</employees>
</company>
<company>
<ticker>SYMC</ticker>
<name>Symantec Corporation</name>
<mktcap>9,932.483</mktcap>
<sales>1,482.029</sales>
<employees>4300</employees>
</company>
<company>
<ticker>INFY</ticker>
<name>Infosys Technologies Ltd.</name>
<mktcap>9,763.851</mktcap>
<sales>830.748</sales>
<employees>15400</employees>
</company>
<company>
<ticker>INTU</ticker>
<name>Intuit Inc.</name>
<mktcap>9,702.477</mktcap>
<sales>1,650.743</sales>
<employees>6700</employees>
</company>
<company>
<ticker>ADBE</ticker>
<name>Adobe Systems Incorporate</name>
<mktcap>9,533.050</mktcap>
<sales>1,230.817</sales>
<employees>3341</employees>
</company>
<company>
<ticker>PSFT</ticker>
<name>PeopleSoft, Inc.</name>
<mktcap>8,246.467</mktcap>
<sales>1,941.167</sales>
<employees>8180</employees>
</company>
<company>
<ticker>SEBL</ticker>
<name>Siebel Systems, Inc.</name>
<mktcap>5,434.649</mktcap>
<sales>1,417.952</sales>
<employees>5909</employees>
</company>
<company>
<ticker>BEAS</ticker>
<name>BEA Systems, Inc.</name>
<mktcap>5,111.813</mktcap>
<sales>965.694</sales>
<employees>3063</employees>
</company>
<company>
<ticker>SNPS</ticker>
<name>Synopsys, Inc.</name>
<mktcap>4,482.535</mktcap>
<sales>1,169.786</sales>
<employees>4254</employees>
</company>
<company>
<ticker>CHKP</ticker>
<name>Check Point Software Tech</name>
<mktcap>4,396.853</mktcap>
<sales>424.769</sales>
<employees>1203</employees>
</company>
<company>
<ticker>MERQ</ticker>
<name>Mercury Interactive Corp.</name>
<mktcap>4,325.488</mktcap>
<sales>444.063</sales>
<employees>1822</employees>
</company>
<company>
<ticker>DOX</ticker>
<name>Amdocs Limited</name>
<mktcap>4,288.017</mktcap>
<sales>1,427.088</sales>
<employees>9400</employees>
</company>
<company>
<ticker>CTXS</ticker>
<name>Citrix Systems, Inc.</name>
<mktcap>3,946.485</mktcap>
<sales>554.222</sales>
<employees>1670</employees>
</company>
<company>
<ticker>KNM</ticker>
<name>Konami Corporation (ADR)</name>
<mktcap>3,710.784</mktcap>
<sales>.000</sales>
<employees>4313</employees>
</company>
</companies>
</xml>
<script>
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// get reference to the xml data island node
var xml, node = document.getElementById("xmlDataIsland");
// IE
if (window.ActiveXObject) {
xml = node;
}
// Mozilla
else {
xml = document.implementation.createDocument("","", null);
xml.appendChild(node.selectSingleNode("*"));
}
// provide data XML
table.setXML(xml);
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,76 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-column-5 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create data formats
var string = new Active.Formats.String;
var number1 = new Active.Formats.Number;
var number2 = new Active.Formats.Number;
var date = new Active.Formats.Date;
// define formatting rule for text output
number1.setTextFormat("#,###.##");
number2.setTextFormat("");
date.setTextFormat("dd mmm yy");
date.setDataFormat("ISO8061");
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// provide data URL
table.setURL("../data/companies-dataset.xml");
// set rows XPath
table.setRows("//NewDataSet/*");
// set columns XPath
table.setColumns(["ticker", "name", "mktcap", "sales", "employees", "timestamp"]);
// set column formatting
table.setFormats([string, string, number1, number1, number2, date]);
// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees", "Date"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,36 @@
<html>
<head>
<style> body, html {margin:0px; padding: 0px; overflow: hidden; font: menu;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<style>
.active-column-0 {width: 400px}
.active-column-1 {text-align: right}
</style>
</head>
<body>
<script>
var string = new Active.Formats.String;
var date = new Active.Formats.Date;
date.setTextFormat("d mmm");
date.setDataFormat("RFC822");
var data = new Active.XML.Table;
data.setURL("http://msdn.microsoft.com/rss.xml");
data.setRows("//item");
data.setFormats([string, date]);
data.request();
var obj = new Active.Controls.Grid;
obj.setDataModel(data);
obj.setColumnProperty("texts", ["Title", "Date"]);
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,53 @@
<html>
<head>
<title>ActiveWidgets Grid :: Examples</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}
.active-column-0 {width: 80px;}
.active-column-1 {width: 200px; background-color: threedlightshadow;}
.active-column-2 {text-align: right;}
.active-column-3 {text-align: right;}
.active-column-4 {text-align: right;}
.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>
<script>
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// provide data URL
table.setURL("../data/companies-simple.xml");
// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// write grid html to the page
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,38 @@
<html>
<head>
<style> body, html {margin:0px; padding: 0px; overflow: hidden; font: menu;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<style>
.active-column-0 {width: 400px}
</style>
</head>
<body>
<script>
var date = new Active.Formats.Date;
date.setTextFormat("[ddd, d mmm]");
var data = new Active.XML.Table;
data.setURL("http://www.xignite.com/xWorldNews.asmx/GetTopStories");
data.setParameter("CriteriaType", "Region");
data.setParameter("CategoryName", "West Europe");
data.setParameter("StoryCount", 20);
data.setNamespace("xi", "http://www.xignite.com/services/");
data.setRows("//xi:Abstract");
data.setColumns(["xi:Title", "xi:Source", "xi:City", "xi:Language", "xi:InsertDate"]);
data.setFormat(date, 4);
data.request();
var obj = new Active.Controls.Grid;
obj.setDataModel(data);
obj.setColumnProperty("texts", ["Title", "Source", "City", "Language", "Date"]);
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,30 @@
<html>
<head>
<style> body, html {margin:0px; padding: 0px; overflow: hidden; font: menu;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
</head>
<body>
<script>
var symbols = [ "MSFT","ORCL","SAP","CA","ERTS","TIBX","VRTS","SYMC","INFY","INTU",
"ADBE","PSFT","SEBL","BEAS","SNPS","CHKP","MERQ","DOX","CTXS","KNM"];
var data = new Active.XML.Table;
data.setURL("http://www.xignite.com/xQuotes.asmx/GetQuotes");
data.setParameter("Symbol", symbols);
data.setNamespace("xi", "http://www.xignite.com/services/");
data.setColumns(["xi:Symbol", "xi:Name", "xi:Last", "xi:Change", "xi:Volume"]);
data.request();
var obj = new Active.Controls.Grid;
obj.setDataModel(data);
obj.setColumnProperty("texts", ["Ticker", "Company", "Last", "Change", "Volume"]);
document.write(obj);
</script>
</body>
</html>

View file

@ -0,0 +1,77 @@
<?php
/*
include this file into your PHP page
usage example:
*/
/*
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table` limit 0,20";
// database connection
$connection = mysql_connect("localhost", "user", "password");
mysql_select_db("database");
// query results
$data = mysql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
*/
function activewidgets_grid($name, &$data){
$row_count = @mysql_num_rows($data);
$column_count = @mysql_num_fields($data);
$columns = "var ".$name."_columns = [\n";
for ($i=0; $i < $column_count; $i++) {
$columns .= "\"".@mysql_field_name($data, $i)."\", ";
}
$columns .= "\n];\n";
$rows = "var ".$name."_data = [\n";
while ($result = @mysql_fetch_array($data)) {
$rows .= "[";
for ($i=0; $i < $column_count; $i++) {
$rows .= "\"".activewidgets_html($result[$i])."\", ";
}
$rows .= "],\n";
}
$rows .= "];\n";
$html = "<"."script".">\n";
$html .= $columns;
$html .= $rows;
$html .= "try {\n";
$html .= " var $name = new Active.Controls.Grid;\n";
$html .= " $name.setRowCount($row_count);\n";
$html .= " $name.setColumnCount($column_count);\n";
$html .= " $name.setDataText(function(i, j){return ".$name."_data[i][j]});\n";
$html .= " $name.setColumnText(function(i){return ".$name."_columns[i]});\n";
$html .= " document.write($name);\n";
$html .= "}\n";
$html .= "catch (error){\n";
$html .= " document.write(error.description);\n";
$html .= "}\n";
$html .= "</"."script".">\n";
return $html;
}
function activewidgets_html($msg){
$msg = addslashes($msg);
$msg = str_replace("\n", "\\n", $msg);
$msg = str_replace("\r", "\\r", $msg);
$msg = htmlspecialchars($msg);
return $msg;
}
?>

View file

@ -0,0 +1,37 @@
<html>
<head>
<title>ActiveWidgets Grid :: PHP Example</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;font: menu;border: none;} </style>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>
<!-- ActiveWidgets PHP functions -->
<?php include("activewidgets.php") ?>
</head>
<body>
<?php
// grid object name
$name = "obj";
// SQL query
$query = "select * from `table` limit 0,20";
// database connection
$connection = mysql_connect("localhost", "user", "password");
mysql_select_db("database");
// query results
$data = mysql_query($query, $connection);
// add grid to the page
echo activewidgets_grid($name, $data);
?>
</body>
</html>