Posting here in case this helps anyone else:
I had a case where I needed to bind a simply JSON object to a listView. The issue was that the listView when using grouping sorts on the group field, so if you have:
And chose to do this:
Then the resulting list will be oddly sorted:
0-11, 10-30, 8-20
The trick here is to sort by one field but use another in the headerTemplate:
And then use a function as the headerTemplate to use another field completely:
This allows you to create your own sort by creating a specific "order" field without having to use it as the group title.