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

Initial Expand/Collapse Behavior #38

Open
gemiur opened this issue May 29, 2017 · 9 comments
Open

Initial Expand/Collapse Behavior #38

gemiur opened this issue May 29, 2017 · 9 comments
Labels

Comments

@gemiur
Copy link

gemiur commented May 29, 2017

Hi Nagarajan , first of all many thanks for your great work on pivot table. I found it very useful but there is something I wish to achieve which is not yet supported currently, correct me if I am wrong. I wonder if we can set the default expand/collapse behavior in the first place. Right now when I expand a parent element, all levels of child elements will be expanded by default, making the tree unnecessarily long when one does not need to see all child elements. I would like to have this manually expanded.

Thanks.
Pang

@nagarajanchinnasamy
Copy link
Owner

Hi @gemiur, you are welcome :)

If you collapse the rows/columns initially using collapseRowsAt and/or collapseColsAt options, then the descendant elements can only be expanded/collapsed manually.

Please check the behavior in this example

Let me know if this meets your expectations.

@gemiur
Copy link
Author

gemiur commented May 30, 2017

Hi @nagarajanchinnasamy ,

Let's use your example to explain my situation. What I wish to achieve is if I set collapesRowsAt to 0, and when expanding Female, only Province elements will be expanded, Age Bin will still be hidden. What it happens now is both Province and Age Bin are expanded automatically. I have 4 items in the Row, last item has many child elements in it so I don't want it to automatically expand as this will make the entire table very long.

Hope this makes sense.

Thanks.
Pang

@nagarajanchinnasamy
Copy link
Owner

Hi @gemiur,

Understood the issue now :). Will take it up as a defect.

Thanks for your feedback.

@nagarajanchinnasamy
Copy link
Owner

After further analysis, i realized that this may not be a defect. By default, the table is built with all rows and columns expanded so that user doesn't have to click at every level to get everything expanded. When collapseAt option is used, a click at that level is mimicked. This just hides the sub items. Doesn't really collapse them. Hence the current behavior.

Still thinking how your requirement can be met.

@gemiur
Copy link
Author

gemiur commented Sep 5, 2017

Hi @nagarajanchinnasamy ,

Thanks for your reply.

In that case, is it possible to have an expandAll option so that when it is set to false all child items will be hidden ? Imagine this as a normal directory tree in Windows Explorer, I wouldn't want all child elements get expanded each time I open the Explorer, it will be very messy :)

@nagarajanchinnasamy
Copy link
Owner

@gemiur

Agree. An option to choose the initial behavior should help.

Thanks for your feedback.

@nagarajanchinnasamy
Copy link
Owner

After further thought, I chose to experiment with using collapseAt options. Last commit in branch v1-11.0 handles the column collapsing. Still work in progress. Don't touch the rows yet :)

@nagarajanchinnasamy
Copy link
Owner

Column Collapsing, Row collapsing and showing row subtotals at the bottom implemented. Please check latest v1-11.0 branch. Pending: Row expansion when displaying subtotals at the bottom.

Am using examples/210_collapse_rowscols.html to test and debug.

@nagarajanchinnasamy
Copy link
Owner

nagarajanchinnasamy commented Nov 26, 2017

@gemiur and friends,

Please check the latest version at v1-11.0 branch. I will merge this branch into master after your confirmation.

Thanks :)

nagarajanchinnasamy added a commit that referenced this issue Dec 3, 2017
* [#38] Initial Expand/Collapse Behavior

* [#38, #12] Initial Expand/Collapse Behavior, Row subtotal at bottom

* rowSubtotalDisplay.displayOnTop: true/false introduced

* subtotal at bottom - row collapse implemented

* bug fixes when using combinations of options

* complete rewrite

* code cleanup

* code cleanup

* code cleanup

* code refactoring

* code refactoring

* Code refactoring

* code re-factoring

* code cleanup

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

* code refactoring

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

No branches or pull requests

2 participants