I have my data as below loaded by store
what is the best way to access meta data, in below case "custom_one", "custom_two", or please suggest any other way?
Code:
{
"total": "20",
"custom_one": "abc",
"custom_two": "efg",
"tasks": [{
"id": "1",
"project_id": "1",
"title": "My First Task",
"description": "My First Task Description",
"status": "pending",
"date_created": "13-03-1986",
"date_completed": "14-03-1986",
"date_invoiced": "15-03-1986"
}, {
"id": "2",
"project_id": "1",
"title": "My Second Task",
"description": "My First Task Description",
"status": "pending",
"date_created": "13-03-1986",
"date_completed": "14-03-1986",
"date_invoiced": "15-03-1986"
}]
}
My store is as below:
Code:
Ext.define('MTT.store.Tasks', {
extend: 'Ext.data.Store',
config: {
autoLoad: true,
model: 'MTT.model.Tasks',
proxy: {
type: 'jsonp',
url: 'http://localhost/amit/mtracktasks/MTT/data/tasks.php',
reader: {
type: 'json',
idProperty: 'id',
rootProperty: 'tasks'
}
},
filters: {
property: 'status',
value: /pending/
}
}
});
My Model is as below:
Code:
Ext.define('MTT.model.Tasks', {
extend: 'Ext.data.Model',
config: {
fields: [{
name: 'id',
type: 'int'
}, {
name: 'project_id',
type: 'int'
}, {
name: 'title',
type: 'string'
}, {
name: 'description',
type: 'string'
}, {
name: 'status',
type: 'inclusion',
list: ['pending', 'completed', 'invoiced']
}, {
name: 'date_created',
type: 'date',
dateFormat: 'd-m-Y'
}, {
name: 'date_completed',
type: 'date',
dateFormat: 'd-m-Y'
}, {
name: 'date_invoiced',
type: 'date',
dateFormat: 'd-m-Y'
}]
}
});
Can you please give a link or an example?
Thanks in advance.