I'm attempting to populate a grid with a data store that uses a proxy and a defined model and reader. Similar stores aren't having the same issue, but one is.
Model
Ext.define('DrillDescriptionGridModel', {
extend: 'Ext.data.Model',
fields: [
{name: 'sentTime', type: 'string'},
{name: 'sDescription', type: 'string'},
{name: 'receivedTime', type: 'string'},
{name: 'seconds', type: 'number'},
{name: 'formatted', type: 'string'},
{name: 'alertPhone', type: 'string'},
{name: 'alertEmail', type: 'string'}
]
});
Reader
var DrillDescriptionReader = Ext.create('Ext.data.JsonReader', {
type: 'json',
model: 'DrillDescriptionGridModel',
root: 'data'
});
Store
DrillDescriptionStore = Ext.create('Ext.data.Store', {
model: 'DrillDescriptionGridModel',
autoLoad: false,
proxy: {
type: 'ajax',
url: '/inc/ajax/Monitors.php',
actionMethods: 'POST',
reader: DrillDescriptionReader
},
listeners: {
load: function() {
console.log(this.getAt(0));
DrillDescriptionPanel.show();
}
}
});
The proxy returns a json string
{"data":[{"sDescription":"Status Normal","sentTime":"12:00:00 am","receivedTime":"12:00:01 am","seconds":"2","formatted":"2 seconds","alertPhone":"","alertEmail":""}, [...]
The console.log in the load listener displays
Ext.Class.c.m
data: Object
alertEmail: ""
alertPhone: ""
formatted: "2 seconds"
receivedTime: "12:00:01 am"
seconds: 2
sentTime: "12:00:00 am"
__proto__: Object
[...]
raw: Object
alertEmail: ""
alertPhone: ""
formatted: "2 seconds"
receivedTime: "12:00:01 am"
sDescription: "Status Normal"
seconds: 2
sentTime: "12:00:00 am"
__proto__: Object
[...]
Anyone know why the sDescription field would be mapped in the raw object, but not the data object, or spot an error in the code? Any help would be greatly appreciated. Thanks.