Ext,DirectStore ,读取ashx返回的值,一直处于loading,不能正确加载

conbing 2014-03-03
部分代码:
Ext.define('App.Test.Panel', {
    extend: 'App.centerTab.Panel',
    constructor: function (config) {
        var me = this;
        Ext.apply(me, {
            items: [{
                xtype: 'grid',
                title: '简单测试',
                width: 300,
                height: 200,
                columns: [{ header: '名称', datIndex: '111', width: 80 }, { header: '描述', dataIndex: '222', width: 200}],
                store: Ext.create('App.Test.Store', {})
            }],
            title: '测试'
        });
        this.callParent(arguments);
        me.down('grid').store.load(function () {
            var a = arguments;
        }
    );
        var a = 0;
    }
});

Ext.define('Model', {
extend:'Ext.data.Model',
fields: [{ name: "LicId", type: 'int' }, { name: "LicName", type: 'string' }, { name: "LicObject", type: 'string'}]
});

Ext.define('App.Test.Store', {
    extend: 'Ext.data.Store',
    model:'Model',
    proxy: {
        type: 'direct',
        api: {
            create: App.TestAction.Insert,
            read: App.TestAction.SelectAll,
            update: App.TestAction.Update,
            destory: App.TestAction.Delete
        },
        reader: {
            type: 'json',
            root: 'rows',
            idProperty: 'LicId',
            totalProperty: 'count',
            successProperty: 'success'
        }
    },
    writer:writer
});

Ext.direct.Manager.addProvider({
    type: 'remoting',
    url: 'DataManager/DataManager.ashx',
    actions: {
        TestAction: [{ name: 'SelectAll', params: ['id', 'name', 'memonic'] }, { name: 'Update', params: ['id', 'data'] }, { name: 'Insert', params: ['id', 'data'] }, { name: 'Delete', params: ['data']}]

    },
    enableBuffer:true,
    namespace: 'App'
});

===================
后台返回数据格式
{"count":30,"rows":[{"LicId":0,"LicName":"0号","LicObject":"qse"},{"LicId":1,"LicName":"1号","LicObject":"qse"},{"LicId":2,"LicName":"2号","LicObject":"qse"},{"LicId":3,"LicName":"3号","LicObject":"qse"},{"LicId":4,"LicName":"4号","LicObject":"qse"},{"LicId":5,"LicName":"5号","LicObject":"qse"},{"LicId":6,"LicName":"6号","LicObject":"qse"},{"LicId":7,"LicName":"7号","LicObject":"qse"},{"LicId":8,"LicName":"8号","LicObject":"qse"},{"LicId":9,"LicName":"9号","LicObject":"qse"},{"LicId":10,"LicName":"10号","LicObject":"qse"},{"LicId":11,"LicName":"11号","LicObject":"qse"},{"LicId":12,"LicName":"12号","LicObject":"qse"},{"LicId":13,"LicName":"13号","LicObject":"qse"},{"LicId":14,"LicName":"14号","LicObject":"qse"},{"LicId":15,"LicName":"15号","LicObject":"qse"},{"LicId":16,"LicName":"16号","LicObject":"qse"},{"LicId":17,"LicName":"17号","LicObject":"qse"},{"LicId":18,"LicName":"18号","LicObject":"qse"},{"LicId":19,"LicName":"19号","LicObject":"qse"},{"LicId":20,"LicName":"20号","LicObject":"qse"},{"LicId":21,"LicName":"21号","LicObject":"qse"},{"LicId":22,"LicName":"22号","LicObject":"qse"},{"LicId":23,"LicName":"23号","LicObject":"qse"},{"LicId":24,"LicName":"24号","LicObject":"qse"},{"LicId":25,"LicName":"25号","LicObject":"qse"},{"LicId":26,"LicName":"26号","LicObject":"qse"},{"LicId":27,"LicName":"27号","LicObject":"qse"},{"LicId":28,"LicName":"28号","LicObject":"qse"},{"LicId":29,"LicName":"29号","LicObject":"qse"}],"success":true}


数据返回到前台,但是grid一直处于加载状态,也未触发store的callback事件。。不知道是什么问题,感觉很二
conbing 2014-03-04
已解决,结贴。
Global site tag (gtag.js) - Google Analytics