Dispaly total row count in data grid

Hi All,

i have set the property statusBar to true in data grid’s grid options and able to show the footer section but not able to display the row count and other aggregation functions like sum etc in the footer.
Please let me know if anyone got any idea related to this.

Thank you in advance
Ali

This can be resolved by using the footerText property of the column.
Most easy approach would be to create a form variable and populate this with the row count like:

utils.numberFormat(databaseManager.getFoundSetCount(foundset), '#')

Then in te footerText property use the form variable like this:

Count: %%fvRowCount%%

A similar approach can be used for the aggregate.
How you will get the aggregate value depends on the architecture of your dataModel.

Hope this helps

Hi Marc,

Thank you it is working.

Best Regards,

Ali Saleem

Has the Servoy grid been updated with the ag-grid aggregate functions yet or do we wait for NG2 or?
I also wanted to use the aggregate functions in the grid like example 1 here: JavaScript Grid: Aggregation | AG Grid
Setting the columndef as per these instructions does not produce any row aggregation.
I might be doing it wrong or the Servoy interface may not implement this.
The columndef is:

enableValue=true
aggFunc = 'sum'

and for the column that is groupBy:

rowGroup=true

I am not able to do the next couple of steps because I do not know how to get the columnApi. The example shows:

After the grid is initialised, there are two steps to set an aggregation on a column:

    Set the aggregation function on the column via columnApi.setColumnAggFunc(colKey, aggFunc)
    Add the columns to the list of value columns via columnApi.addValueColumn(colKey)

When the grid initialises, any column definitions that have aggFunc set will be automatically added as a value column.

My objective is to provide sub-totals in the row of the group by column.
I have been using the form var to display in the footer the Servoy aggrgates but it would be nice use case to display the totals per group across the row.

Are there other ways to achieve this.
Using Serovy 2021.03 latest (not ng2).

the aggregate support from ag-grid is only for ‘client-side-row’ model, and we already added support for that in powergrid, there is a column property ‘aggFunc’; datagrid uses ‘server-side-row’ model, so there this won’t work

Thanks, that was not obvious in any wiki (for me anyway).