:: Forum >>

problem when two grids populated dynamically

I created two grids dynamically. I am having calendar images in two grids. when I click I am sending the number of myDataArray (myDataArray1) but I am not able to send individual grid objects. I am populating the grids by writing the code inside a function and passing dynamically the gridno and grid object as parameters to the function.
for(var i=0;i<2;i++)
{
.........
var gridno = "grid"+i;
var gridobj = "gridobj"+i;
createGrid(gridno,gridobj);
...
}

function createGrid(gno,gobj)
{
gno = new Active.Grid...
.......
}
kamesh
Tuesday, October 18, 2005
I would suggest to create both grids outside the createGrid function
(public-vars), if not the variables are "private", and can not be reffered outside.
What I usually do is:

for(var i=0;i<2;i++) {
.........
var gridno = "grid"+i;
var gridobj = "gridobj"+i;
eval("var grid"+ i + "= new Active.Controls.Grid");
eval("var gridobj"+ i + "= new Active.Controls.Grid");
customizeGrid(gridno,gridobj);
}

And use customizeGrid for the rest part that not need a variable declaration.
HTH
Carlos
Tuesday, October 18, 2005
Sorry should be...
for(var i=0;i<2;i++) {
eval("var grid"+ i + "= new Active.Controls.Grid");
eval("var gridobj"+ i + "= new Active.Controls.Grid");
customizeGrid(gridno + i , gridobj + i);
}
Carlos
Tuesday, October 18, 2005
Thanks for the support I am working on it
kamesh
Tuesday, October 18, 2005

This topic is archived.


Back to support forum

Forum search