Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ListGrid Header Sorting

$
0
0
SmartGWT version: v9.0p_2013-07-29/PowerEdition Deployment (built 2013-07-29)

Browser(s) : All IE and MozillaFirefox.

I have a list grid that get populated with data from the below query:

Code:


select co1, col2, sum(col3), sum(col4) from myTable group by col1, col2;

And i am using custom query to execute this query in DS file
Code:


<operationBinding operationId="Linear" operationType="fetch">
 <selectClause>$rawValue.advancedCriteria.col_names</selectClause>
 <whereClause>$defaultWhereClause</whereClause>
 <groupClause>$rawValue.advancedCriteria.group_by_cols</groupClause>
</operationBinding>

After the grid is populated, i try to use the grid header sorting on col3 and col4 in built feature. But it gives me following error:

ORA: NOt a group by function.

My analysis:
I was creating ListGridFields for each column being displayed in the grid.
For col3/col4, the list grid field is created as
Code:

listGridField3 = new ListGridField(col3, title);
So, the grid header sorting fires again a query with col3 and not sum(col3) because of which this error is coming.

So i changed the listgridfield creation to:
Code:

listGridField3 = new ListGridField(sum(col3), title);
Then the group by error stopped coming but the data in that column is not sorted.

Can you please help me understand how grid header sorting works in case of grouping columns in list grid and how could i solve this problem.

Viewing all articles
Browse latest Browse all 4756

Latest Images

Trending Articles



Latest Images