[GL #172] Summary calculations do not work with Filters

Tags: #<Tag:0x00007f8b1deddff0> #<Tag:0x00007f8b1deddeb0>

Hi Team,

two issued we have faced that could need a fix on priority:

  1. we have implemented sum, min, max using columnSummary option. That works fine when the data is loaded for the first time on the handsontable grid. Once we reduce the dataSet on the grid by applying filters, the summary calculations do not show up. they disappear.

  2. minSpareRows works fine. it adds extra rows. but when used with columnSummary to be shown on last row inserted by minSpareRows, the sum is shown as doubled that the actual value. For example, if the sum of column ‘x’ is 20 and we intend to show it on last row, then when used minSpareRows to insert last row then sum of column is shown as 40.

Thanks in advance

Hi @rohit.parwal

you are right, the filters doesn’t work as expected with summaryCalculations. Here we can replicate is easily http://jsfiddle.net/gayee360/
The issue has been reported some time ago on our internal ticketing system, however, it hasn’t been scheduled yet.

Please send me your email or write me at support@handsontable.com and I’ll send you a feedback as soon as one of the issues will be fixed.

1 Like

I have been working on a workaround for the issue at http://jsfiddle.net/fL5c889g/ but got only partially good results. I am posting the demo here as maybe the following solution will work better in your project

Thanks Aleksandra, we have implemented other workaround in our project, but do let us know once you put a fix in future releases. Is this thread visible to public? want to make sure before we share our email Ids with you…

OK, I will inform you as soon as possible. I have added a personal note to the internal ticketing system where the issue has been reported in the first place.

Hi Aleksandra,

We are also using the column summary and filters plugin on the same table and getting issues. Has there been any updates on this topic lately?

I’m not sure if this is making it more complex, but we would like to keep the summary row to only calculate the items that are visible. I’m assuming that the code should work similar to the sorting plugin. When you use the sort, it ignores the column summary on the first row. Would it be possible for the filter plug in to also ignore the first row?

Thanks for your time,
Ryan

Thank you for sharing your concerns, Ryan. Unfortunately, I do not see any new commits related to this part of the code. Hopefully, every change in Handsontable PRO code will be published (we are switching to Github) and then we will be able to show all needed information right away.

We do not allow to change the way that filters work, meaning there are no API methods to change the current behavior.

Hi

I am using a similar workaroud, but setDataAtCell seems to be affecting the undo functionality.
Ideally we’d need a ColumnSorting plugin which does not affect the undo/redo and takes into account the filters.

I’ve posted a question to a related topic regarding this: