The answer to this question might be different based on your version of SKUID and whether or not you’re using V1 or V2 pages.
As far as I’ve discovered in our use of V1 pages, it is not possible to sort on UI only fields. In fact for us we can only sort/search from database querying, any option for Client side search / sort doesn’t seem to work for us.
You may be able to achieve this by sorting the model’s data using a javascript snippet and then running render() on any related components to make sure they update their display based on the new sorting.
For example:
//Make sure model data is properly sorted
skuid.$M('OurModelName').data.sort((a, b) => (a.FieldToSortOn__c > b.FieldToSortOn__c) ? 1 : -1);
//Re-render a component (eg, a table) after sorting
try{skuid.$C('IdOfComponentToReRender').render();} catch(e){console.error(e);}
Mark is correct. In V1 we only supported server side sort - where the sort action triggered the addition of an “Order by” statement to the SOQL query -and requeried.
In V2 we do support client side sort on the table as a whole - and this would allow you to sort based on your UI only field.
In V1 we do have a “Sort Action” which allows client side sort. It wouldn’t be exactly the same as the table icons, but you could add a button on your page that triggered the sort action…
Options. Options. Options…