I've implemented the Expand/Collapse buttons for pivot table and it works fine only for fixed single column or we can say static table only with fixed dimension.
Referenced from below links:
We have a long dataset and we are getting that data from an API and, so we don't know the dimension name (as dataset change based on ID we sending in request).
So we don't know the dimension name in advance in this scenario, but I filtered that dataset and get the dimension name somehow and set it and it work fine for that column.
Once the dataset rendered in pivot table, then if we change the dimension from "Fields" then buttons not working because that newly selected dimension name not set there.
So how can we change the dimension name dynamically in runtime?
Other one is that, when I added a rows in default set dimension by 3 level, then try to expand, then it's targeting only default set dimension only not internal items.
So how can we handle these type of scenarios, please let us know.
Thank you for reaching out to us.
You can use the
getAllHierarchies API call to access all the field names. Also, it is possible to get the names of the current fields on the grid using the
getReport method. Then, you can use those field names from the
report.slice object when implementing the logic of expand/collapse buttons.
Please let us know if it works for you. Looking forward to hearing from you.
Hope you are doing well.
We were wondering if you had a chance to check the suggested approach. Could you please confirm if it works for you?
Looking forward to hearing your feedback.
Hope you are doing great.
Just checking in to ask if you had a chance to check the
getReport API calls. Please let us know if they work for you.
Looking forward to hearing from you.
Sorry for delay, this worked, thank you!
Thank you for the feedback!
We are glad to hear that it works for you.
As always, do not hesitate to contact us in case other questions arise.