The values are getting null in grid in Extjs when i am parsing these values from json,basically this is because the properties label are with dots.
"properties": {
"financialYear": "2009",
"employee.employeeId": "12345",
"employee.employeeName": "abc"
}
How do i get employee.employeeId value in .js to be displayed in Extjs grid.
Right now i am mapping like this in .js,
Ext.define('DocProperties',{
extend: 'Ext.data.Model',
fields: [
{name: 'financialYear', type: 'string'},
{name:'employeeId', mapping:'properties.employee.employeeId',type: 'string'},
]});
and for display in grid panel i am accessing like this,
{
width:100,
header: "Employee ID",
dataIndex: 'employeeId',
sortable: true
}
any solution or workaround for this.
@DmitryB thanks,But this did not solve my problem,I have my store like this
Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
model: 'DocResult',
autoLoad: true,
proxy: {
type: 'rest',
url : 'sample-data.json',
reader: {
type: 'json',
root: 'results',
useSimpleAccessors: true
}
}
});
and in my model i defined like this
Ext.define('DocResult',{
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name:'employeeId', mapping:'properties.employee.employeeId',type: 'string'}
] });
and then also in my Ext grid display the empty value comes .Please help.
Just looking through the source code, you might try the following:
Try this in combination with
useSimpleAccessorsset to eithertrueorfalse, and let me know what the outcome is.