PDA

View Full Version : Problem with localstorage - add element



hihei
10 Feb 2012, 6:26 AM
I have a problem adding an element into store with local storage proxy, I' don't know why I don't find record's key in store but in localStorage the record is saved correctly. When I request the page I find the record key.

:(

Thanks in advance,
Roby

hihei
10 Feb 2012, 6:33 AM
My save function is:

saveOrder : function(){
var currentOrder = this.newOrd.testataOrd.getRecord(); this.newOrd.testataOrd.updateRecord(currentOrder);
var orderStore = this.orderList.OrderList.getStore();
if(null == orderStore.findRecord('idOrdine', currentOrder.data.idOrdine)){ orderStore.add(currentOrder);
}
orderStore.sync();
orderStore.sort([{ property: 'date', direction: 'DESC'}]); this.orderList.OrderList.refresh();

//Return to list
this.setActiveItem(this.orderList);
}




}31589

hihei
10 Feb 2012, 8:40 AM
I think it's problem with "internalId" . . .