handleRefresh : function (evt) { var that = this; // trigger search again and hide pullToRefresh when data ready var list = this.getView().byId("list"); var binding = list.getBinding("items"); var handler = function() { that.getView().byId("pullToRefresh").hide(); binding.detachDataReceived(handler); }; binding.attachDataReceived(handler); that._updateList(); }, _updateList : function () { var filters = []; // add filter for search var searchString = this.getView().byId("searchField").getValue(); if (searchString && searchString.length > 0) { var filter = new sap.ui.model.Filter("ID", sap.ui.model.FilterOperator.Contains, searchString); filters.push(filter); } // add filter for filter var select = this.getView().byId("filterSelect"); var key = select.getSelectedKey(); var filterMap = { "5k" : new sap.ui.model.Filter("Amount", sap.ui.model.FilterOperator.GE, 5000), "10k" : new sap.ui.model.Filter("Amount", sap.ui.model.FilterOperator.GE, 10000) }; if (filterMap[key]) { filters.push(filterMap[key]); } // update list binding var list = this.getView().byId("list"); var binding = list.getBinding("items"); binding.filter(filters); },
↧
Re: SAPUI5 m PullToRefresh
↧