We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

How can the value be hidden when collapsed and only displayed when all expanded?

Answered
TONY TUNG asked on January 11, 2024

I would like to hide the value when a row or column is collapsed, and only display the value when the row or column is all expanded.
 
Thanks.

3 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster January 11, 2024

Hello Tony,

Thank you for contacting us and sharing the screenshots.

We recommend using the customizeCell API call to hide values when rows or columns are collapsed. Please check the following JSFiddle for illustration: https://jsfiddle.net/flexmonster/1zvdgLhe/. Feel free to customize the suggested approach for your use case.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia 

Public
TONY TUNG January 13, 2024

Hi, 
I think the sample code is not work.
Can I check the collapse / expanded value to be false / true for header field?
then assign the cell value for value field?
 
 
Or any setting to disable auto calculation when row / column are collapsed (i.e. Not Auto Calculate.PNG)?
Thanks.
Best Regards,
Tony

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster January 15, 2024

Hello Tony,

Thank you for the response.

Kindly note that such behavior is not supported out of the box. However, it can be achieved using the  customizeCell API call. This method allows you to control which data will be in the cells. For example, you can hide the cell value using the cell.text property:

cell.text = ""

To check if there are expands in columns or rows, you can use data.columns.length and data.rows.length properties. With this in mind, you can create your logic of hiding the values in cells.

We hope it helps. You are welcome to contact us in case other questions arise.

Kind regards,
Nadia

Please login or Register to Submit Answer