Dec 04, 2011, 10:50 PM
Store.loadData()
I have a store with an ArrayReader attached to a GridPanel. I am collecting information from the user and attempting to add/edit records and store them in the grid.
After entering data into the UI I add a record via this server side code
When a user wants to edit the data they click the grid and a popup window is presented. When they finish editing the data I am trying to update the record in the grid with store.loadData()
Thanks for anyone who can help.
After entering data into the UI I add a record via this server side code
TimesheetItem item = new TimesheetItem();
item.TimesheetId = counter++;
.
.
.
this.storeTimesheets.InsertRecord(0, ObjectUtil.TurnObjectIntoDictionary(item);
this.storeTimesheets.CommitChanges();
This works fine and updates the grid with my new records.When a user wants to edit the data they click the grid and a popup window is presented. When they finish editing the data I am trying to update the record in the grid with store.loadData()
this.storeTimesheets.LoadData(JSON.Serialize(item));
on the client side it looks like this
ctl00_ContentPlaceHolder1_storeTimesheets.loadData({"TimesheetId":1,"JobId":"","WorkOrderId":2108,"WorkOrderNo":"3200004","StateId":0,"State":"NSW","OpSuffix":"","Date":"2011-12-21T00:00:00","EmployeeId":6227,"Employee":"70005643 - ANGUS AITCHISON","SiteRateCodeId":90,"SiteRateCode":"200","PayrollQty":2.0,"InvoiceQty":2.0,"Note":"","DelayCodeId":0,"DelayCode":null,"DateWorked":null});
This just wipes out any data that is in the grid. Am I doing this correctly? Should I be using a different method?Thanks for anyone who can help.