2017-01-12 112 views
1

我正在使用下面的代碼來篩選數據值搜索幫助中有三個輸入組項目如下,但我無法獲得在這三個字段中給出的數據進行篩選。無法使用篩選器欄搜索

 var oFilterBar = new sap.ui.comp.filterbar.FilterBar({ 
     advancedMode: true, 
     filterBarExpanded: true, 
     showGoOnFB: !sap.ui.Device.system.phone, 
     filterGroupItems: [new sap.ui.comp.filterbar.FilterGroupItem({ groupTitle: "foo", groupName: "gn1", name: "n1", label: "Orderid", control: new sap.m.Input()}), 
          new sap.ui.comp.filterbar.FilterGroupItem({ groupTitle: "foo", groupName: "gn1", name: "n2", label: "OrderType", control: new sap.m.Input()}), 
          new sap.ui.comp.filterbar.FilterGroupItem({ groupTitle: "foo", groupName: "gn1", name: "n3", label: "Planplant", control: new sap.m.Input()})], 

    search: function() { 
      // var iOrder = sap.ui.getCore().byId("oFilterBar"); 
      // sap.m.MessageToast.show("Search pressed '"); 
         oTable.bindRows({path: "/OrderDataSet", filters: [ 
    new sap.ui.model.Filter("Orderid",sap.ui.model.FilterOperator.EQ, iOrder)] 
    // new sap.ui.model.Filter("Planplant",sap.ui.model.FilterOperator.EQ, iPlan), 
    // new sap.ui.model.Filter("Description",sap.ui.model.FilterOperator.EQ, iDes)] 
     }); 
     } 

回答

0

這是一個diferent情況,但是,可以幫助得到你想要的

search : function(oEvent) { 
      var oSource = oEvent.getSource(); 
      var oBarContent = oSource.getContent(); 
      var oToolBarContent = oBarContent[0].getContent(); 
      var oSearch = oToolBarContent[1]; 
      var sValue = oSearch.getValue();