MSPJGRID CurrentRow / getItem problem

G

gobogo90

I am trying to loop through an array created using the
MSPJGRID.CurrentRow method.

I can access each member of the array explicitly, but not using a
variable. So, in JSCRIPT. Example:

var rows = MSPJGRID.Currentrows
var nLength = rows.ubound() - rows.lbound() + 1;
for (i=1;i<=nLength;i++)
{
var rpProjID = MSPJGrid.GetCellValue(rows.getItem(i),
'<%=const_dbWPROJ_ID%>');
}

If I use rows.getItem(1), the line executes. If I use rows.getItem(i)
the line will not exexute. I'm stumped....any ideas?

Thanks,
Greg Steinbach
 
E

Eug

I don't understand what you are trying to do. You seem to be trying to
iterate through the selected rows but you've only got one row which is
the current row.

The following bit of code will alert a cell value for each row shown in
the grid.

var rows = MSPJGrid.GetNumRows([0]);

for(x=0;x<rows;x++) {
if(typeof(MSPJGrid.GetCellValue(x, <CELLNAME>)) != "undefined") {
alert(MSPJGrid.GetCellValue(x, <CELLNAME>));
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top