:: Forum >>

Can I put it inside a table

Can I put it inside a table
Monday, February 6, 2006
Yes you can
Rob Francis
Monday, February 6, 2006
yep

<table>
<tr><td>other stuff</td></tr>
....
<tr><td id='insertAWGRIDhere'></td></tr>
</table>

<script>
var obj = new AW.UI.Grid;
obj .setId("myGrid");
obj .setSize(600, 250);
obj .setCellText(function(i, j){return j + "-" + i});
obj .setHeaderText("header");
obj .setColumnCount(3);
obj .setRowCount(3);
obj .setCellEditable(true);
document.getElementById("insertAWGRIDhere").innerHTML=obj.toString();
Monday, February 6, 2006
Could some one please post a complete example as above?
Where do you write it out?
How does "inserAWGridhere" relate to "myGrid" IN ABOVE above...

very confusing demo??
ideas?
Tuesday, February 21, 2006
You just have to have the javascript that writes out the grid to appear where you need it within your html

<html><head>
<script src="runtime/lib/aw.js"></script>
<link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head> <body>

<script>

var myData = [
["aa","USPS ","0","9"],
["bb","Email","1","9"],
["cc","FedEX","2","9"],
["cc","FedEX","2","9"],
["dd","Phone","1","9"]
];

var obj = new AW.UI.Grid;

obj.setCellText(myData);

obj.setColumnCount(3);
obj.setRowCount(5);

</script>

Here is some text on a page

<table border=10 cellpadding=10 cellspacing=10>
<tr><td>Add a grid to this column using line below<br>

<script>
document.write(obj);
</script>

</td></tr></table>

</body>
</html>
Rob Francis
Tuesday, February 21, 2006
Please note, if you are trying to use Firefox using a grid within tables, sometimes your grid will not play nicely with % widths or heights inside your tables. It's basically a Firefox issue. 1.5 seems to have addressed some of these problems.
Tony
Tuesday, February 21, 2006

This topic is archived.


Back to support forum

Forum search