Reputation: 103
I have this consult to show all the data on a grid, and I need to show only one per element, for that reason I think I need a groupBy or distinct. I'm really new :c
This is my code:
public void init()
{
super();
filterGrid = this.query().dataSourceTable(tableNum(Table)).addRange(fieldNum(Table,Field));
}
I need a GroupBy here but I dont know how to put or where.
Upvotes: 0
Views: 3962
Reputation: 18051
You may be closer than you think, edit the datasource init
method to look like this:
public void init()
{
super();
this.query().dataSourceTable(tableNum(Table)).addGroupByField(fieldNum(Table,Field));
}
Upvotes: 3