Daniel Lemos Itaborai
Daniel Lemos Itaborai

Reputation: 118

Sorting on a calculated field

Is it possible to use a sorter over a calculated field? If so, how would it look like on an XML view?

I couldn't find anything on the docs or in the openui5 github repo.

Upvotes: 1

Views: 254

Answers (1)

cschuff
cschuff

Reputation: 5542

Short version: No, it's not possible in a XMLView!

Long Version:

  1. You can create a separate field on your model with the calculated value in advance and sort on that newly created field.
  2. You can easily create and apply the sorter from the corresponding controller. A Sorter can implement it's own compare function like this: Sorting and Filtering in JSON Models

Upvotes: 1

Related Questions