Is there a way to enumerate currently opened viewers and views using JS API?
This is not exactly what you are asking about, but still might be helpful: grok.shell.tableNames
shows the names of currently open tables (taking into account cloned table views and postfixing them like that: tableName (n)
), and grok.shell.tables
gets the underlying dataframes (for views based on the same table, the dataframe object will be listed several times). If you are interested in views, they can be collected as follows: grok.shell.tableNames.map(name => grok.shell.getTableView(name))
.
Plus, there’s an iterator for viewers attached to a table view (including Grid), e.g.
for (let viewer of grok.shell.v.viewers) {
console.log(viewer.type);
}
1 Like
I also added grok.shell.views
and grok.shell.tableViews
, you will be able to use them in the next build.
2 Likes
thanks for the awesome information.