If you use a JSON model for data binding, sorting and filtering is implemented in JavaScript because the data is available on the client. You can use custom sorting and filtering methods in the JSON 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", 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; };