Displaying group count in aggrid

Forum to discuss the new web client version of Servoy.

Displaying group count in aggrid

Postby jay.rao » Fri Jun 22, 2018 11:43 am

Hi,
I am trying to customise the AGGRID for the test. I want to display the child counts on grouping the column.For e.g, if I have grouped the column Status I want to see the total count of child records in each Status group, ACTIVE(21), CLOSED(5) etc.
As we have groupingtable_server.js where we get groupedfoundset, I want to get the count for each group as well in the foundset.

Code: Select all
parentFoundset.getQuery();
var childFoundset = parentFoundset.duplicateFoundSet();
var query = parentFoundset.getQuery();
groupColumn = query.getColumn(groupDataprovider);
query.result.clear();
query.result.addPk();
var pkColumns = query.result.getColumns();
query.result.clear();
query.result.add(query.columns.pkColumnName.count)
for (var i = 0; i < pkColumns.length; i++) {
         query.result.add(pkColumns[i].min);
      }
query.groupBy.add(groupColumn);
childFoundset.loadRecords(query)


But when we add the count to the query result it throws the warning
"The query does not have the correct number of pks in the select"

Do you have any suggestions on what am I doing wrong here?
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Return to Servoy NGClient

Who is online

Users browsing this forum: Google [Bot] and 5 guests