3.2.0

HELP: referencing rows after filtering

I have a grid. Initially it has 20 rows.
Then I apply a filter to the grid and end up with 7 rows.

Here is my problem. I'm not exactly sure how to reference the data in those rows. I can "getRowCount()" and get 7. But if I try to reference the rows 1-7, I get the data from the original rows (the 20).

I'm trying to do it this way, and I'm sure it is wrong, I just can't figure it out and I hope someone can help:

for (i=0; i<obj.getRowCount(); i++) {
   document.write(getCellText(12,getRowIndices[i]));
}


My thought was that the getRowIndices[i] would return the appropriate row number (for the row value in the getCellText piece).

Any ideas? Any help would be appreciated.
Carl
March 16,
Carl,

yes, you should use getRowIndices method which returns an array of row indices or null if each row index == row position (0..rowCount-1)

for (i=0; i<obj.getRowCount(); i++) { 
   var a = obj.getRowIndices();
   var row = a ? a[i] : i;
   document.write(obj.getCellText(12, row)); 
}
Alex (ActiveWidgets)
March 16,
Thanks Alex. I see what I was doing wrong. I wasn't referencing the array values correctly.

Works really well now. Thanks.
Carl
March 17,

This topic is archived.

See also:


Back to support forum