2012-10-05 72 views
1

我想構建一個用戶可以編輯,添加,刪除條目的數據網格存儲在JavaScript變量中作爲json。我把它作爲一個重複工作,但它需要很多工作來維護。當我嘗試使用dojo.store.Memory時,出現錯誤。 這是8.5.3與UP1,試圖使用ext庫。如何使用本地json數據的dojo數據網格

var Lodging = [{"CheckIn":"" ,"Check-out":"","Nights":"","Hotel":"","Rate":"","JTR":"","JTRcomments":""}]; 
var jtrStore = new dojo.store.Memory({data:Lodging, idProperty: "CheckIn"}); 

錯誤:

com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript action expression In the control : _id3 At line 2, column 31 of: #{javascript:var Lodging = [{"CheckIn":"" ,"Check-out":"","Nights":"","Hotel":"","Rate":"","JTR":"","JTRcomments":""}]; var jtrStore = new dojo.store.Memory({data:Lodging, idProperty: "CheckIn"}); } 

回答

0

dojo.store.Memory是一個客戶端JS構建體。你的錯誤表明你在一個服務器端腳本。這是行不通的。 Serverside dojo正在進行中,並且在任何已發佈的XPage版本中都不可用。您想將該代碼放入腳本塊,以便將其發送到客戶端執行

+0

謝謝你會嘗試 – Kalechi