1
我對odata查詢有過濾。有沒有辦法將結果的數據存儲到另一個模型(JSON)中。我需要搜索過濾器來搜索列表中顯示的項目,而不是搜索整個odata模型。如何將OData查詢的結果數據存儲到JSON模型
updateProductsList : function(){
var filters = [];
filters.push(new sap.ui.model.Filter("SalesOrganization", sap.ui.model.FilterOperator.EQ, this.oSalesOrganization));
filters.push(new sap.ui.model.Filter("DistributionChannel", sap.ui.model.FilterOperator.EQ, this.DistributionChannel));
filters.push(new sap.ui.model.Filter("ProductID", sap.ui.model.FilterOperator.Contains, this.sFilterPattern));
filters.push(new sap.ui.model.Filter("CustomerNo", sap.ui.model.FilterOperator.EQ, this.oCustomerID));
this.setDefaultSelection = true;
this.getList().bindItems("/Products", new sap.ui.xmlfragment("cus.sd.salesorder.create.view.ProductListItemTemplate",this), null,filters);
console.log("getPRODList0 " + this.getList().bindItems("/Products", new sap.ui.xmlfragment("cus.sd.salesorder.create.view.ProductListItemTemplate",this), null,filters));
var sTitle = this.getView().byId("SOC_MasterListHeaderTitle");
sTitle.setText(this.oApplicationFacade.getResourceBundle().getText("PRODUCTS_CUST", [this.CustName]));
this.registerMasterListBind(this.getList());
console.log("getPRODList " + this.getList().getBinding("items").sPath);
console.log("getPRODList2 " + this.getList().getBindingContext());
console.log("getPRODList3 " + this.getList().getModel());
},
特別提到的「複製數組只是將引用複製到數組中,而不復制它」在這裏很重要:) – Qualiture