function addRow(){
var rowData = ["GGL", "Google, Inc", "9,999.999", "765.432", "10000"]
myData.unshift(rowData);
obj.setRowProperty("count", myData.length);
obj.refresh();
}
<html>
<head>
<script src="/runtime/lib/aw.js"></script>
<link href="/runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<style>
#theButton {width: 120px;}
#theGrid {width: 100%; height: 350px; }
#theGrid .aw-grid-control {height: 100%; width: 100%; margin: 0px; border: none; font: menu;}
#theGrid .aw-grid-row {border-bottom: 1px solid threedlightshadow;}
#theGrid .aw-column-0 {width: 150px; text-align: left; border-right: 1px dotted #ccc;}
#theGrid .aw-column-1 {width: 150px; text-align: left; border-right: 1px dotted #ccc;}
#theGrid .aw-column-2 {width: 150px; text-align: left; border-right: 1px dotted #ccc;}
#theGrid .aw-column-3 {width: 150px; text-align: right; border-right: 1px dotted #ccc;}
#theGrid .aw-column-4 {width: 150px; text-align: left; border-right: 1px dotted #ccc;}
#theGrid .aw-alternate-even {background: #fff;}
#theGrid .aw-alternate-odd {background: #eee;}
</style>
<script>
var myColumns = ["C1","C2","C3","C4","C5"];
var myData = [];
//var myData = [ ["CTX","Citrix, Inc","10","20","30"] ];
var obj = new AW.Grid.Extended;
obj.setId("theGrid");
obj.setHeaderText(myColumns);
obj.setCellData(myData);
obj.setColumnCount(myColumns.length);
obj.setRowCount(myData.length);
document.write(obj);
</script>
<body>
<input type=button value="Click to insert" onclick="
alert('Insert');
var rowData = ['GGL', 'Google, Inc', '9,999.999', '765.432', '10000'];
myData.push(rowData);
obj.setRowProperty('count',myData.length);
obj.refresh();
">
</body>
</html>
obj.setCellData(myData);
<input type=button value="Click to insert" onclick="
alert('Insert');
var rowData = ['GGL', 'Google, Inc', '9,999.999', '765.432', '10000'];
myData.push(rowData);
obj.setCellData(myData);
obj.setRowProperty('count',myData.length);
obj.refresh();
">
This topic is archived.