Sort doesn't work for a DataGrid with Invoke on API

I have a DataGrid, that loads the data from an API (Swagger).
All works fine, but when I try to sort by a column (by clicking on the colum, and yes, the "AllowSorting" option is TRUE), I see the "sorting arrow" appearing on the column, but nothing happens, it doesn't sort.

When I had data coming from a DB in another DataGrid, this was working.

So is there anything particular that must be done when the data is coming from an API? How do I sort in this case a column?

Sorting works in the same way as filtering (see my answer in your other thread). Plain REST/Swagger services cannot sort, filter or page.

thank you for the answer.
For filtering I solved, basically I use a Textbox, and in its Change event, I pass a function that will filter the DataSet variable used to load the grid. It works perfectly.

But for Sorting, I really cannot figure out how to manually do it?
I just need a simple alphabetical sorting on the column that is clicked.
Is there a way to call a function when a column's sorting icon is clicked?

In that case I can manually sort my DataSet, but I need to know which column has been clicked

Every sort, filter or page will trigger LoadData event of the grid with more info about sorting, filtering, paging, etc. in event argument properties.

thank you again,
ok after console.logging the event I see that it fills the attibute : "orderBy" of the ${event} object.

And I also saw that it will return the column name or the column name + "desc".

That is good, so as I don't want to call the API again on each oderBy, would it make sense to put in the LoadData Invoke, under "Condition" a check like:

${event.orderby} == "";

so it will trigger only if the LoadData wasn't triggered by a OrderBy, and then I will execute some custom code to Filter my DataSet object and manually Order it.

Thank you for the support

EDIT: after some tests, it seems that if I put a condition on the Invoke, after LoadData is triggered, it won't just take the previous data that it loaded, but it will "load" forever.
So I guess after each Sort a new call to the API is a must, is this correct?

Hi, do you have an example of how to subscribe to the loaddata event?