If you use an XML model for data binding, sorting and filtering is implemented in JavaScript because all data is available on the client. You can use custom methods for sorting and filtering in an XML model. To define custom methods, set the fnCompare method on the Sorter object or the fnTest method on the Filter object after creating it.
#!jsvar oFilter = new sap.ui.model.Filter("property"); oFilter.fnFilter = function(value) { return (value > 100); };
#!jsvar oSorter = new sap.ui.model.Sorter("property"); oSorter.fnCompare = function(value1, value2) { if (value1 < value2) return -1; if (value1 == value2) return 0; if (value1 > value2) return 1; };