Dispaly total row count in data grid

Forum to discuss the new web client version of Servoy.

Dispaly total row count in data grid

Postby aliqazi01 » Wed Nov 06, 2019 4:47 pm

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
aliqazi01
 
Posts: 14
Joined: Mon Nov 04, 2013 7:35 am

Re: Dispaly total row count in data grid

Postby mboegem » Mon Nov 11, 2019 10:47 am

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:
Code: Select all
utils.numberFormat(databaseManager.getFoundSetCount(foundset), '#')


Then in te footerText property use the form variable like this:
Code: Select all
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
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1574
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Dispaly total row count in data grid

Postby aliqazi01 » Tue Nov 12, 2019 10:09 am

Hi Marc,

Thank you it is working.

Best Regards,

Ali Saleem
aliqazi01
 
Posts: 14
Joined: Mon Nov 04, 2013 7:35 am

Re: Dispaly total row count in data grid

Postby pitc » Thu May 27, 2021 3:27 pm

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: https://www.ag-grid.com/javascript-grid/aggregation/#recomputing-aggregates
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:
Code: Select all
enableValue=true
aggFunc = 'sum'


and for the column that is groupBy:
Code: Select all
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:
Code: Select all
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).
Tom
prospect-saas.com
pitc
 
Posts: 89
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada

Re: Dispaly total row count in data grid

Postby Gabi Boros » Fri May 28, 2021 8:40 am

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
Gabi Boros
Servoy
Gabi Boros
 
Posts: 376
Joined: Tue Jun 26, 2007 4:03 pm
Location: Timisoara, Romania

Re: Dispaly total row count in data grid

Postby pitc » Fri May 28, 2021 6:02 pm

Thanks, that was not obvious in any wiki (for me anyway).
Tom
prospect-saas.com
pitc
 
Posts: 89
Joined: Thu Nov 14, 2019 2:22 pm
Location: Ottawa, Ontario, Canada


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 3 guests