Skip to main content
15-Moonstone
December 2, 2019
Solved

Sorting the Advanced Grid widget.

  • December 2, 2019
  • 2 replies
  • 3722 views

Hi. I have an infotable bound to an Advanced Grid widget (using v4.2.1 from the marketplace) and I see that the column sorting is not readily available as it is with the standard Grid widget. I checked the documentation, and it only specifies how to sort columns when you have Data Table as a source, but I'm interested in using infotables. 

 

I have a service that sorts the infotable based on a column input, but I don't see how that could help me, as I can't dynamically pass the column name to the service.

 

Can anyone give me some help on this? Thank you

Best answer by Radu

I figured it out. It is a very similar way to the method presented in the documentation.

 

When working with infotables, you have to use the InfoTableFunctions resource (click + on the mashup and search InfoTableFunctions, and select the service called Query). You bind the infotable you want to be sorted, plus the QueryFilter property (first check EnableSorting) of the Advanced Grid to the parameters of the Query service. Then you have to bind the "Filter" event of the Advanced Grid to run the "Query" service.

 

The Connections panel should look like this:

image.png

 

2 replies

18-Opal
December 2, 2019

Hello @Radu,

 

The sort settings are part of QueryFilter parameter, you need to pass it to the server side, where you can use it in your queries like this:

query: { sorts: queryFilter.sorts }

 

/ Constantine 

Radu15-MoonstoneAuthor
15-Moonstone
December 2, 2019

Hi Constantine,

 

Thank you for your answer. Why is the server side processing necessary? Does the result have to be passed back to the QueryFilter property of the grid?

18-Opal
December 2, 2019

Hello Radu,

 

Server-side processing is required mostly for paging scenarios, when you have thousands of rows, which you don't want to transfer to the client in one big bunch.

 

It might support some client-side sorting (like simple Grid does), but I've never used it, so cannot help.

 

/ Constantine

Radu15-MoonstoneAuthorAnswer
15-Moonstone
December 3, 2019

I figured it out. It is a very similar way to the method presented in the documentation.

 

When working with infotables, you have to use the InfoTableFunctions resource (click + on the mashup and search InfoTableFunctions, and select the service called Query). You bind the infotable you want to be sorted, plus the QueryFilter property (first check EnableSorting) of the Advanced Grid to the parameters of the Query service. Then you have to bind the "Filter" event of the Advanced Grid to run the "Query" service.

 

The Connections panel should look like this:

image.png