Hi,
I have a grid with, for example, 2 rows (id=2 and id=4).
The following code gives i the value of “2” in the first loop, but gives i the value of “,” in the second loop (instead of “4”).
Why is that? Isn’t getAllRowIds() supposed to return an array? If not, how can I use getAllRowIds() to get an array?
for (var i=0; i < mygrid2.getAllRowIds().length; i++) {
a = mygrid2.cells(mygrid2.getAllRowIds()[i],4).getValue();
b = mygrid2.cells(mygrid2.getAllRowIds()[i],1).getValue();
c = mygrid2.cells(mygrid2.getAllRowIds()[i],2).cell.childNodes[0].innerHTML;
}
getAllRowIds returns the comma separated list of values
It can be used as
var ids = mygrid2.getAllRowIds().split(",");
for (var i=0; i < ids.length; i++) {
…
Also there is a built in itterator, which can be used for the same task <br> dhtmlx.com/docs/products/dhtmlxG … ingthrough
Thank you.
The built-in iterator forEachRow is simple and works well.