:: Forum >>

how to embed this in html


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>grid diplay</title>

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->


<script language="JavaScript" src="./src/aw.js">
var myCells = [
["MSFT","Microsoft Corporation", "314,571.156"],
["ORCL", "Oracle Corporation", "62,615.266"]
];

var myHeaders = ["Ticker", "Company Name", "Market Cap."];

// create grid object
var obj = new AW.UI.Grid;
alert("obj is"+obj);
// assign cells and headers text
obj.setCellText(myCells);
obj.setHeaderText(myHeaders);

// set number of columns/rows
obj.setColumnCount(3);
obj.setRowCount(2);

// write grid to the page
document.write(obj);
</script>

</head>

<body>

</body>
</html>


this is my code. when i deploy n execute i dont find any datagrid. can any one tell me what might be wrong.
sushma
Saturday, October 14, 2006
There were a few errors in the script and link tags.
This works for me:

<html>
<head>
<title>grid diplay</title>

<link rel="stylesheet" type="text/css" href="activewidgets/runtime/styles/xp/aw.css">


<script language="JavaScript" src="activewidgets/runtime/lib/aw.js"></script>
<script language="JavaScript">
var myCells = [
["MSFT","Microsoft Corporation", "314,571.156"],
["ORCL", "Oracle Corporation", "62,615.266"]
];

var myHeaders = ["Ticker", "Company Name", "Market Cap."];

// create grid object
var obj = new AW.UI.Grid;
//alert("obj is"+obj);
// assign cells and headers text
obj.setCellText(myCells);
obj.setHeaderText(myHeaders);

// set number of columns/rows
obj.setColumnCount(3);
obj.setRowCount(2);

// write grid to the page
document.write(obj);
</script>

</head>

<body>

</body>
</html>
Ankur Motreja
Saturday, October 14, 2006
Hi ankur,


My application directory structure is as below,


test2
|-->src
|-->runtime


I have pasted "Runtime" folder of the downloaded zip file into my src folder.
Kindly tell me how to write the script and link tag

regards
sushma
sushma
Saturday, October 14, 2006
Just change the path in the code I've given to point to the activewidgets .js and .css files.
It will probably be test2/src/runtime/styles/xp/aw.css and test2/src/runtime/lib/aw.js in your case.
Ankur Motreja
Saturday, October 14, 2006
hi,

i did what u suggested but still the same error!!! AW not defined

my code is as below

<html>
<head>
<title>grid diplay</title>

<link rel="stylesheet" type="text/css" href="test2/src/runtime/styles/xp/aw.css"></link>


<script language="JavaScript" src="test2/src/runtime/lib/aw.js"></script>
<script language="JavaScript">
var myCells = [
["MSFT","Microsoft Corporation", "314,571.156"],
["ORCL", "Oracle Corporation", "62,615.266"]
];

var myHeaders = ["Ticker", "Company Name", "Market Cap."];

// create grid object
var obj = new AW.UI.Grid;
//alert("obj is"+obj);
// assign cells and headers text
obj.setCellText(myCells);
obj.setHeaderText(myHeaders);

// set number of columns/rows
obj.setColumnCount(3);
obj.setRowCount(2);

// write grid to the page
document.write(obj);
</script>

</head>

<body>

</body>
</html>


still i face the same problem.I am using Eclipse IDE to deploy this app.any advise would be welcomed.


sushma
Saturday, October 14, 2006

This topic is archived.


Back to support forum

Forum search