:: Forum >>

Active Undifined

HI,

I am getting an JS error Active undefined, whenever I run this in IE 6.0

This line is giving problem.

var obj = new Active.Controls.Grid;

But the same thing is running fine on IE 5.5.

Please can anyone help me with this?


Shyam
Monday, June 20, 2005
The grid.js file is not getting fully loaded before you are trying to instantiate the grid object. Show me the code that you have for loading the grid.js file and where you are calling the grid create.
Jim Hunter
Monday, June 20, 2005
Hi Jim,

First of all, Thanks for your reply. Here is the code snippet,

I am using XSL.
To start with in a CDATA section I am including the JS file and creating the grid object.
---------------------------------------------------------------------
<xsl:text disable-output-escaping="yes">
<![CDATA[
<link href="/js/runtime/styles/xp/grid.css" rel="stylesheet" type="text/css"/>
<script language='JavaScript' src='/js/Active/runtime/lib/grid.js'></script>
<script language='JavaScript'>
//create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
</script>
]]>
</xsl:text>
---------------------------------------------------------------------
In the later part of the code in a template I am accessing this obj. I am building arrays of column headings and row data and using them.

//provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});

var alternate = function(){
return this.getProperty("row/order") % 2 ? "#f5f5f5" : "#FFFFFF";}

//set headers width/height
obj.setRowHeaderWidth("0px");
obj.setColumnHeaderHeight("20px");

//set click action handler
obj.setAction("click", function(src){window.status = src.getItemProperty("text")});

document.write(obj);

I tried putting the logic of including the file outside CDATA section and initialising the grid just before using it. Even then no luck with it.

Looking forward for your help.

Thanks
Shyam
Tuesday, June 21, 2005
Sorry,

The second line in the CDATA section is

<script language='JavaScript' src='/js/runtime/lib/grid.js'></script>

:)
Shyam
Tuesday, June 21, 2005
Why are you using a CDATA section? Do you have a great reason for doing so? Check out this thread and you might learn that they are more of a pain then you might think:

http://www.sitepoint.com/forums/showthread.php?p=1955911#post1955911

Jim Hunter
Wednesday, June 22, 2005

This topic is archived.


Back to support forum

Forum search