Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse rows in pivot table by default #2861

Closed
lyjeileen opened this issue Nov 28, 2024 · 2 comments
Closed

Collapse rows in pivot table by default #2861

lyjeileen opened this issue Nov 28, 2024 · 2 comments

Comments

@lyjeileen
Copy link

Bug Report

Is there a way to configure the pivot table to collapse rows by default? Currently, the table rows are not collapsed on initial page render, but they collapse if the table is scrolled. I attempted to use view.set_depth(0) to achieve this behaviour, but it did not work as expected.

I also referred to the following issue for guidance: #2295. However, it appears that the notifyResize(true) method has been removed or is no longer available. Is there an alternative approach to achieve this functionality?

Steps to Reproduce:

  1. Git clone the sample project
  2. Run npm i, npm run local, npm run start:prod
  3. Open http://127.0.0.1:8080/

I'm using react instead of pure javascript.

Expected Result:

  • Table rows should be collapsed by default.
Screenshot 2024-11-28 at 3 03 36 PM

Actual Result:

  • Initially, table rows are not collapsed.
  • After scrolling, the rows collapse as expected.

Nov-28-2024 15-10-05

Environment:

@finos/perspective version: 3.1.2
browser and version: Google Chrome Version 130.0.6723.70
OS: macOS Sonoma version 14.5

@texodus
Copy link
Member

texodus commented Feb 2, 2025

notifyResize() was renamed to resize() docs here. You can use this API like this:

const view = await viewer.getView();
await view.set_depth(0);
await viewer.resize();

@texodus texodus closed this as completed Feb 2, 2025
@lyjeileen
Copy link
Author

@texodus Thank you so much! It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants