The idProperty property invalid of reader.
Ext version tested:
Ext 4.1.1(GA)
Browser versions tested against:
Chromium 18.0.1025.168 (Ubuntu 12.04)
Description:
The idProperty property invalid of reader.
Code:
Ext.define('App.store.ContactsList', {
extend: 'Ext.data.Store',
fields: [
{ name: 'userid', type: 'int' },
{ name: 'ownerid', type: 'int'},
{ name: 'rname', type: 'string'},
{ name: 'call', type: 'string' },
{ name: 'email', type: 'string' },
{ name: 'online', type: 'int'},
{ name: 'sex', type: 'boolean' },
{ name: 'usertype', type: 'string'}
],
proxy: {
type: 'rest',
appendId: false,
url: '/openService.ashx/contactlist',
headers: { 'Accept': 'application/json' },
writer: {
type: 'json',
allowSingle: true
,writeAllFields: true
},
reader: {
type: 'json',
root: 'data',
idProperty: 'userid'
},
listeners: { exception: proxyFailure
}
}
});
var ctlStore=Ext.create('App.store.ContactsList',{autoLoad: true, autoSync: false});
Log(ctlStore.getCount()); // log: 3
ctlStore.each(function (record) {
Log(record.getId()); //No log
});