2017-09-26 57 views
1

我的manifest.json如何從getDefaultCountMode數據到我的控制器

"mainService_SRV": { 
      "uri": "/sap/opu/odata/sap/mainService_SRV/", 
      "type": "OData", 
      "settings": { 
       "odataVersion": "2.0", 
       "localUri": "localService/metadata.xml", 
        "defaultCountMode": "Inline" 
      } 
     }, 

因此我能夠得到的記錄的總數在我的批處理文件,這樣使用默認計數模式: total number of records

現在,我想用這個計數到我的控制器。我試着用下面的代碼 this.getView().getModel("model_Name").getDefaultCountMode()

但是得到一個錯誤getDefaultCountMode不是函數。

一個想法如何被訪問?提前致謝。

回答

0

getDefaultCountMode方法將返回默認計數模式以檢索集合數。它不會返回任何EntitySet的記錄數。它由SAPUI5控件(如列表,表格和圖表)在內部使用。這些控件計算的計數不能通過框架直接獲得。您可能可以檢查計數的綁定長度。如果您使用的是List控件,則可以附加一個updateFinished事件&獲取事件參數中的總記錄數。

相關問題