我試着從JsonModel獲得從模型屬性的陣列
得到物業,這是我的代碼:
acountsJson = sap.ui.getCore().getModel("acounts").getProperty("/acounts/"); alert(acountsJson.length); acoutnJson[0].getProperty("/uName");
在第一個警報,我得到了lenght,但我不能讓財產。
我試着從JsonModel獲得從模型屬性的陣列
得到物業,這是我的代碼:
acountsJson = sap.ui.getCore().getModel("acounts").getProperty("/acounts/"); alert(acountsJson.length); acoutnJson[0].getProperty("/uName");
在第一個警報,我得到了lenght,但我不能讓財產。
的getProperty
結果是一個JavaScript對象,這樣你就可以通過使用.
在你的情況得到內部元素acountsJson[0].uName
我建議你使用console.log
,而不是alert
,你可以得到更詳細的輸出。
acoutnJson [0] .getProperty(「/ uName」);
acount拼寫錯誤也許這是爲什麼?