loadexception with JsonStore: TypeError: Record has no properties
July 4th, 2009
obj = function(p){
new Ext.data.JsonStore({
reader: new Ext.data.JsonReader({
id: 'id',
root: 'rows',
successProperty: 'success',
totalProperty: 'total'
}, p.dataModel)
,url: 'json.php?t=' + p.type + '&id=' + p.id
,storeId: p.type + p.id
,autoLoad: true
,listeners: {'load': p.onLoad,'beforeload': p.onLoad, 'loadexception': function(t,o,a,e){alert('ex '+e);}}
});
};
the response to the ajax request is that:
{"success":true,"total":1,"rows":[{"id":"2","nm":"B",.....}],"timestamp":1207331604}
with firebug i try this:
obj({type:'t',
id:2,
dataModel:Ext.data.Record.create([
{name: 'id', type: 'int'}
,{name: 'nm', type: 'string'}
]),
onLoad:function(){alert('.');}})
and the result is that i have an alert('.') (the beforeload event) and then i have the alert of the loadexception with the message: "TypeError: Record has no properties"
where is the error?
thanks
{name: 'id', type: 'int'}
,{name: 'nm', type: 'string'}
]
it's in the object passed to obj()
#If you have any other info about this subject , Please add it free.# |