Ext.onReady(function(){
//数据模型
Ext.define('dm', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'department', type: 'string'},
        {name: 'id',   type: 'int'},
        {name: 'name',  type: 'string'},
        {name: 'pwd', type: 'string'},
        {name: 'sex',   type: 'string'}
    ]
});

//数据存储
var store = Ext.create('Ext.data.Store', {
 //  autoLoad: true,
    model:'dm',
              proxy: {
        type: 'jsonp',
        url:'actionlist.do',
        reader: {
            type: 'json',
            totalProperty: 'pageCount',
            root: 'users',
           id:'id'
        }
    }  
});
store.load();

Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    el:'props-grid',
    store: store,
    columns: [
        { header: '编号',  dataIndex: 'id' },
        { header: '姓名', dataIndex: 'name' },
        { header: '性别', dataIndex: 'sex' },
        { header: '部门', dataIndex: 'department' },
        { header: '密码', dataIndex: 'pwd' }
    ],
    height: 200,
    width: 500,
    renderTo: Ext.getBody()
});
})

解决方案 »

  1.   

    Ext.onReady(function(){
    //数据模型
    Ext.define('dm', {
    extend: 'Ext.data.Model',
    fields: [
    {name: 'department', type: 'string'},
    {name: 'id', type: 'int'},
    {name: 'name', type: 'string'},
    {name: 'pwd', type: 'string'},
    {name: 'sex', type: 'string'}
    ]
    });//数据存储
    var store = Ext.create('Ext.data.Store', {
    // autoLoad: true,
    model:'dm',
      proxy: {
    type: 'jsonp',
    url:'actionlist.do',
    reader: {
    type: 'json',
    totalProperty: 'pageCount',
    root: 'users',
    id:'id'
    }
    }   
    });
    store.load();Ext.create('Ext.grid.Panel', {
    title: 'Simpsons',
    el:'props-grid',
    store: store,
    columns: [
    { header: '编号', dataIndex: 'id' },
    { header: '姓名', dataIndex: 'name' },
    { header: '性别', dataIndex: 'sex' },
    { header: '部门', dataIndex: 'department' },
    { header: '密码', dataIndex: 'pwd' }
    ],
    height: 200,
    width: 500,
    renderTo: Ext.getBody()
    });
    })
      

  2.   

    type: 'jsonp',type:'json',