Hello,
I wanted to expand a certain column including all the levels below when the report loads.
I created a quick sample to show the problem: https://jsfiddle.net/rvkw0e7f/1/
I used your existing sample and slightly tweaked it to show the issue. I want the Accessories column expanded for the Country of Canada by default. I tried some variations of the expandCell method but was unable to achieve the desired result. Am I missing something simple?
Thanks,
Rushi
Hello, Rushi!
Thank you for reaching out to us.
Kindly note that it is possible to predefine the expanded rows in the sliceObject
of your report. For the described case, slice
would look as follows:
slice: {
//other slice properties
expands: {
columns: [
{
tuple: [
"category.[accessories]"
]
},
{
tuple: [
"category.[accessories]",
"country.[canada]"
]
}
]
}
}
We have modified the provided JSFiddle: https://jsfiddle.net/flexmonster/0zbw1kxv/.
You can read more about expands in our docs: https://www.flexmonster.com/doc/slice/#expands.
We also kindly suggest the following generic approach for such cases:
Save
Toolbar tabreport.json
in any text editorYou are welcome to watch the short YouTube video illustrating this approach: https://www.youtube.com/watch?v=GC4C7XLjccc.
Hope you will find our answer helpful.
Kind regards,
Solomiia
Hello Solomiia,
Your solution works great. I am using the component in Blazor so had some trouble setting up the tuples array correctly in C#. However, by looking at your example, I was able to get it working in Blazor.
Thanks,
Rushi
Hello, Rushi!
Thank you for your feedback.
We are glad to hear that the suggested approach works well for you.
Feel free to contact us in case of any other questions.
Kind regards,
Solomiia