안녕을 제거하지 않고 두 번째 필터를 추가합니다. 이런 식으로 :난 뒤에이 코드와 searchfield을 가지고있는 기존에게
onSetFilter : function(oEvent) {
var andFilter = [];
andFilter.push(new Filter("BusArea", FilterOperator.EQ, "5000"));
this._applySearch(andFilter);
},
물론 "BusArea"부분은 어떤 필터가 선택되었는지에 따라 달라집니다. 하나 이상의 필터가 될 수 있습니다. _applySearch 함수는 다음과 같다 :
_applySearch: function(andFilter) {
var oViewModel = this.getModel("worklistView");
this._oTable.getBinding("items").filter(andFilter, true);
// changes the noDataText of the list in case there are no filter results
if (andFilter.length !== 0) {
oViewModel.setProperty("/tableNoDataText",
this.getResourceBundle().getText("worklistNoDataWithSearchText"));
}
}
문제 나 필터 버튼을 통해 필터를 추가 할 때, 검색 창에서 필터가 사라지고 arround를 다른 방법이다. 기존 코드를 제거하지 않고 필터를 추가 할 수 있도록 코드를 어떻게 바꿀 수 있습니까?
를 제출 중 때 우리는 유지하여 여러 개의 필터를 적용() 함수를 입력은 SearchField
모두 글로벌 "filtersModel"에 대해 바인더 제본되어 시뮬레이션, 모두는 _calculateFilters 전화 제어기 레벨의 필터 배열. 그래서 우리는 먼저 this.aFilters.push (oFilter)와 같은 배열로 필터를 푸시 한 다음 this.aFilters를 바인딩에 적용합니다. 더 나은 솔루션을 찾고 있습니다. –