将数据从服务器响应插入网格

时间:2014-06-05 13:01:28

标签: url extjs response

你好我有

 proxy: {
                            type: 'ajax',
                            url: '/book/list?filter=',
                            reader: {
                                type: 'json',
                                root: 'data',
                                successProperty: 'success'
                            }

然后我有来自服务器的响应

data":[{"id":1,"book":"Now","author":"q"}]}

这个日期我希望在网格中插入下一列:Id,Book,Author

1 个答案:

答案 0 :(得分:2)

  

简单。有关详细信息,请查看docs

Ext.create('Ext.grid.Panel', {
title: 'RecordsGrid',
store: yourStore,//your store which contains data returned form the server
columns: [
    { text: 'Id',  dataIndex: 'id' },
    { text: 'Book', dataIndex: 'book'},
    { text: 'Author', dataIndex: 'author' }
]
});