SAPUI5 - Sorting NumericString in xml view

 

numericStringComparator: function(a, b) {
return (parseInt(a, 10) || 0) - (parseInt(b, 10) || 0);
} In your xml view : Binding with items in sap.m.Table
<Table
id="idMyTable"
inset="false"
items="{
path: '/Items', // Your Collection
sorter: {
path: 'ItemNo', // Your string property name
comparator: '.numericStringComparator'
}
}"
updateFinished="onMyableUpdateFinished"
>

Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

SAP Cloud Platform Integration - Splitter

SAP CPI: Recover artifact in SAP CPI (Case Delete)