Hello,
maybe I found a bug, but I would ask you first, before reporting. Perhaps I did a mistake. I tryed to load the content ov en Ext.List via ajax and read the response with json. Here is my config:
Code:
Ext.define('WebApp.model.PageModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'pid', type: 'int' },
{ name: 'title', type: 'string' }
]
}
});
Ext.define('WebApp.store.PageStore', {
extend: 'Ext.data.Store',
require: [ 'WebApp.model.PageModel' ],
config: {
model: 'WebApp.model.PageModel',
storeId: 'PageStore',
proxy: {
type: 'ajax',
url: 'RpcServer/GetPages.php',
reder: {
type: 'json',
root: 'pages'
},
actionMethods: {
read: 'POST'
},
}
},
});
Ext.create('Ext.List', {
store: 'PageStore',
height: 500,
pinHeaders: true,
style: 'opacity:.9;',
itemTpl: '<div class="page">{title}</div>',
items: [{
xtype: 'toolbar',
docked: 'top',
title: 'Menu'
}]
});
If my server response a formatk like the following, all is fine.
Code:
[
{
"id": 55,
"pid": 31,
"title": "General"
},{
"id": 169,
"pid": 31,
"title": "About"
}
]
But I tryed to send some extra infos and whanted to send the json like this:
Code:
{
"pages": [{
"id": 55,
"pid": 31,
"title": "General"
},{
"id": 169,
"pid": 31,
"title": "About"
}],
"total": 2,
"metaData": {
"idProperty": "id",
"rootProperty": "pages",
"totalProperty": "total",
"fields": [{
"name": "id"
},{
"name": "pid"
},{
"name": "title"
}]
},
"success": true
}
In this case, my list shows only one item with the caption "null". I tryed several szenarios, where I did not send metaData and/or set the Property values of the json-reader-object, but nothing happens.
Do you see my mistake, or is it realy a bug?