I’m trying to build a datagrid that user can edit, add, delete entries from that is stored in a JavaScript variable as json. I have it working as a repeat but it is a lot of work to maintain. When I try to use dojo.store.Memory I get an error.
This is 8.5.3 with UP1, trying to use the ext lib.
var Lodging = [{"CheckIn":"" ,"Check-out":"","Nights":"","Hotel":"","Rate":"","JTR":"","JTRcomments":""}];
var jtrStore = new dojo.store.Memory({data:Lodging, idProperty: "CheckIn"});
Error:
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"}); }
dojo.store.Memory is a client side JS construct. Your error indicates that you are inside a server side script. That doesn’t work. Serverside dojo is work in progress and not available in any released version of XPages. You want to put that code into a script block so it gets send to the client for execution