Need a special offer?Find out if your project fits.
+

Expanded colum by default

Answered
Sangamesh asked on August 23, 2019

In columns we have year, quarter, month and date. On click of year, it expands to quarter. We have not used D4+ for other reason. How can I keep only year expanded by default on load

8 answers

Public
Vera Didenko Vera Didenko Flexmonster August 23, 2019

Hello,
 
Thank you for writing to us.
 
To keep only the year expanded by default on load, specify the drills in the slice object:

"drills": {
"rows": [
{
"tuple": [
"flight_date.[2016]"
]
}
]

}

Here is a JSFiddle example for illustration.
 
Please let us know if this works fine for you.
 
Best Regards,
Vera

Public
Sangamesh August 27, 2019

We need 1st level of column value to be expanded by default. Solution posted by you is for rows.
 

Public
Vera Didenko Vera Didenko Flexmonster August 28, 2019

Hello,
 
Thank you for pointing this out.
 
 
To keep only the 1st level of the column value to be expanded by default on load, specify the columns in the drills in the slice object:

"drills": {
"columns": [{
"tuple": [
"flight_date.[2016]"
]
}]
}

Please see the updated version of the JSFiddle example: https://jsfiddle.net/flexmonster/ytde2fk5/.

 
Let us know if this works fine for you.
 
Best Regards,
Vera

Public
Sangamesh August 28, 2019

What if The row fields are not expendables and object like Date,instead they are separate fields. How to keep 1st level open  by default in that case

Public
Vera Didenko Vera Didenko Flexmonster August 29, 2019

Hello, 
 
Thank you for writing to us.
 
In this case, please specify expands in the slice object.
 
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/zwqv986k/.
 
Also, we would like to mention that it is possible to apply different report configurations through the UI, then save the report and see how the configurations are defined in the generated report object.
 
Please let us know if everything works fine for you.
 
Best Regards, 
Vera

Public
Devesh August 29, 2019

Hello Vera,
Thanks for the answer.
As I can see in fiddle, you have added values in expands object and that seems ok for small data and JSON format. Here we have a clarity that ticket field has 'ticket1' 'tickte2' etc. values. But what if we have a large and dynamically varying data coming from API and in CSV format. 
How can we achieve same thing in that case. Waiting for your earliest response.
Thanks in advance.

Public
Vera Didenko Vera Didenko Flexmonster August 30, 2019

Hello, 
 
Thank you for your question.
 
It is also possible to expand members of a specific field via the expandData() API call.
 
Here is a JSFiddle example for illustration: https://jsfiddle.net/flexmonster/5uoqnp1c/.
 
Please let us know if this works.
 
Best Regards, 
Vera

Public
Devesh September 5, 2019

Thanks. It worked

Please login or Register to Submit Answer