cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Sorting the Advanced Grid widget.

Radu
15-Moonstone

Sorting the Advanced Grid widget.

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

1 ACCEPTED SOLUTION

Accepted Solutions
Radu
15-Moonstone
(To: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

 

View solution in original post

4 REPLIES 4

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 

Radu
15-Moonstone
(To:Constantine)

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?

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

Radu
15-Moonstone
(To: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

 

Top Tags