PDA

View Full Version : JsonStore with idProperty



Gunny
5 Feb 2010, 8:03 AM
Hi all,

I have a problem re-loading a record in a jsonstore with idProperty.

this is my store:


var dsTodo = new Ext.data.JsonStore({
url:'../php/GetTodoList.php',
root: 'data',
storeId: 'myStore',
idProperty : 'iTodo',
fields: [{name:'iTodo'}, {name:'vSubject'}]
});


if I call

dsTodo.load({params:{idxTodo:idx}, add:true});

I get "o is undefined" in firebug.

if I delete "add:true" it works and reload ONLY the record (obviously)
if I delete "idProperty: iTodo" it works but the record is appended (obviously)
I'm not able to reload the record updating the record in the jsonStore

Someone can help me?
Thanks.
Giorgio

aconran
5 Feb 2010, 10:54 AM
Let's see what your JSON response looks like.

Gunny
8 Feb 2010, 1:09 AM
hi,
this is the php reply:

{"data":[{"iTodo":"2","dStartDate":"2010-02-10 00:00:00","dEndDate":"2010-02-12 00:00:00","vSubject":"Todo numero 2","vLocation":"Milan","iComplete":"50","iPriority":"2","iPrivate":"0","iState":"0","userId":"1","vUser":"Giorgio","vContact":""}]}

This are all the fields, in my previous post I include only 2 field.

Thanks.

Gunny
9 Feb 2010, 1:01 AM
Someone could help me?
I'm not able to resolve the issue.

Thanks and sorry for the insistence.

Giorgio