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?