3.0.5

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
October 18,
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
October 18,
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
October 18,
Thanks for the support I am working on it
kamesh
October 18,

This topic is archived.

See also:


Back to support forum