I am using grid summary and group summary in checkbox selectable grid. I want to update summary according to selections (eg. 1 / 5). This works for grid summaries so that i call refreshFields on selection and calculate the correct summary in summary function. Group summaries use the same summary function but they are not updated on selection. If I collapse and expand group then group summary is updated. So my question is how to update group summaries on selection ?
You should see that a redraw() causes any customized getGroupTitle() to be called again so that you can provide a new summary. If this does not seem to be the case please provide a standalone test case demonstrating the problem.
what is the recommended way to ask for a redraw (actually just re-evaluate) the summary functions when selection changes?
I find that refreshFields() performs the re-evaluate twice (because of unselect and select event), so a markForRedraw() would be better here to do it only once, but this doesn’t work. Also not on grid.getParentElement().markForRedraw() which is where the summary row Canvas should be child of.
You’re correct - sorry for the confusion here.
We’ve now added an explicit API for this: listGrid.recalculateSummaries()
This API will be present in the next nightly build.