The sorting works basically fine using the sorter. One column is the full name (e.g. "Steve Jobs"). I have only the full name in that entity set but I want to sort the entries by the last name (last word of the full name) when clicking the full name column header. Is there some way to do this?
相关问题
- How to Load Dependencies Relative to Defining Modu
- Shared event handler for XML views with different
- UI5 performance parameters: data-sap-ui-preload vs
- Event for view leave
- How can I access the AST that VSCode creates
相关文章
- How to use “formatMessage” module with i18n model
- where are the SAPUI5 icons stored?
- How to input only month and year in UI5?
- SAPUI5 JSONModel and JSONP
- Required field validator in sapui5
- How to group SAPUI5 OData before bind to control a
- Perform Action after the Binding Is Complete
- SAPUI5 / OpenUI5: Packaging
You'll need to define a custom comparator for the sorter which applies only if all the entities are available client-side, for example, by having the
operationMode
set to'Client'
when defining the OData list binding.APIBtw: the "Client" operation mode currently doesn't fetch all entities if the service has server-side paging implemented.
As you can see in the example above, the
Sorter
constructor can handle custom comparator which will be invoked when thesort
method is called. For comparing last parts of the full names, you can define the comparator like this: