`dataframe.rows.iterator` does not work

Uncaught TypeError: rows.iterator is not a function or its return value is not iterable

Can you provide a broader context? Iterating over rows seems to work just fine in the case below.

Admittedly, I’m not an expert JS programmer, so perhaps I’m doing it wrong, here is the source code:

As you may already know I’m working on a JS viewer. So, the problem I have is basically

export class SunburstViewer extends DG.JsViewer {
...
    onTableAttached(): void {
        for (const row of this.dataframe.rows.iterator()) {
            ...
        }
    }
...
}

Of course, the code is placed inside the callback purely for the lifecycle demonstration purposes.

Wow. Symbol.iterator?! Why so?

So, I can only access the iterator with the exact symbol. Is it declared/exported somewhere?

Ah dumb me. Sorry, there is no need to explicitly access the iterator.

Great, then I presume the current solution is good? Let us know if there is a better, or more canonical way of doing it.

That’s perfectly fine. I never worked with the iterators/generators in JS and have a bit skewed by Java point of view. Thanks for your help.

Ah, I found the issue. The typings were misleading. Will make a PR shortly.

1 Like