i had a jsonStore like this
var ch01_store = new Ext.data.JsonStore({
autoLoad:true,
storeId: 'ch01_store',
proxy: new Ext.data.HttpProxy({
url: 'index.php/test/get_ch01/10',
method: 'POST'
}),
root: 'data',
totalProperty: 'results',
remoteSort: true,
fields: [
{name: 'date_time', mapping: 'date_time'},
{name: 'chart_data', mapping: 'chart_data'}
]
});
and the "localhost/myweb/index.php/test/get_ch01/10" url is resulting this on the page
{
"success": true,
"results": 10,
"data": [{
"date_time": "5/12/2012 13:13:33",
"chart_data": "3.5"
},
{
"date_time": "5/12/2012 13:13:34",
"chart_data": "0.0"
},
{
"date_time": "5/12/2012 13:13:35",
"chart_data": "3.5"
},
{
"date_time": "5/12/2012 13:13:36",
"chart_data": "0.0"
},
{
"date_time": "5/12/2012 13:13:4",
"chart_data": "0.0"
},
{
"date_time": "5/12/2012 13:13:5",
"chart_data": "3.5"
},
{
"date_time": "5/12/2012 13:13:6",
"chart_data": "0.0"
},
{
"date_time": "5/12/2012 13:13:7",
"chart_data": "3.5"
},
{
"date_time": "5/12/2012 13:13:8",
"chart_data": "0.0"
},
{
"date_time": "5/12/2012 13:13:9",
"chart_data": "3.5"
}
]
}
but when i'm execute
console.log(ch01_store.getCount());
the log show zero and I'm trying to populate it on a gridPanel, the result is still empty, can anyone help me?
Set Proxy like this and try:
proxy: {
type: 'ajax',
reader: {
type: 'json',
root: 'xxxxxx'
}
}