Column Groups

Tags: #<Tag:0x00007fee2b0ff890>


We are researching your product and believe its doing everything we require, but we would like to know how to do the following before we purchase:

The Column Grouping functionality (see attached): If you collapse column I is there away of showing the SUM of an aggregation of column O and P rather than showing the O column?

Many thanks


Hi @steve.gamble

I’m happy to hear that Handsontable meets your needs.

When it comes to the mentioned functionality - it is not available by default. So, what you can do is to use the afterColumnCollapse() hook to alter the O’s column data after collapsing I and then bring back the data in the afterColumnExpand() hook.

There are, however, some crucial questions to answer before jumping to the code editor.
Are you planning only to allow users to display the data when the column is collapsed, or will they also be able to alter the values? Cause if they can edit, then you’d need to specify what will happen for the rows that are the source for the SUM.

Another important aspect is do you need to send all the data to the server or export it when the columns are collapsed. If you do, then I would recommend using a cell renderer instead, as it won’t change the value - it will just show something different (in this case the SUM).

Thanks for the very quick reply!

Do you have an examples of using the afterColumnCollapse hook works so I can see this working in process?

At the moment I am not sure if its going to be readonly / editable when the column is collapsed. I am thinking read-only but will need to speak with my team.



Sure, I can help with the demo. Do you use any framework (React, Angular, Vaue2, Vue3)?

Hi @steve.gamble

have you already created a demo or still need some guidance?