You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the perspective-view .collapse() method to displays the rows of my datagrid in a "grouped" state by default.
I'm not sure I'm using it correctly but when trying on one of the project's example I get the error message below
There are a few things conflated here. A View is kind of like a SQL query result set, but live - it holds the state and intermediate data for a set of query config values (e.g. what you put int he UI), including the expansions/collapse state of the tree (if it has one). The line view = await table.view() in your example creates a newView, e.g. not the one that your <perspective-viewer> UI created to render the data. That causes two issues:
This new View has no config options, it was instantiated without an argument in your example, View(). Thus it is un-pivoted, and has no tree to collapse or expand, thus the error. The error is unfortunately obtuse - we'll get that fixed.
Even if it had been pivoted, collapse()/expand() are being called on the wrong View, and won't affect the <perspective-viewer> UI as written.
In addition, you'll need to call .notifyResize(true) subsequently on the <perspective-viewer> to force it to redraw itself, because expand/collapse do not trigger data notifications (currently). So the correct code should look something like this:
... However, it appears the perspective-viewer re-write released in 1.0.0+ did not implement this method getView(), so this is not working in the most recent release yet (In versions <1.0.0, the .view property exists which allows this). I'll keep this report open to track this issue as well as the Error de-obfuscation issue above, these fixes should be in the 1.0.6 release.
Bug Report
I'm trying to use the perspective-view .collapse() method to displays the rows of my datagrid in a "grouped" state by default.
I'm not sure I'm using it correctly but when trying on one of the project's example I get the error message below
Steps to Reproduce:
Expected Result:
update the datagrid display to group rows
Actual Result:
no action on datagrid and error message below
same behaviour / error message with methods .expand() and .set_depth()
The text was updated successfully, but these errors were encountered: