`
cjblog
  • 浏览: 67218 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

extjs store ajax支持同步加载数据

 
阅读更多
Ext.define('Ext.ux.data.proxy.Ajax', {
    extend: 'Ext.data.proxy.Ajax',
	async:true,
    doRequest: function(operation, callback, scope) {
        var writer  = this.getWriter(),
            request = this.buildRequest(operation);  
        if (operation.allowWrite()) {
            request = writer.write(request);
        }
        Ext.apply(request, {
			async		  : this.async,
            binary        : this.binary,
            headers       : this.headers,
            timeout       : this.timeout,
            scope         : this,
            callback      : this.createRequestCallback(request, operation, callback, scope),
            method        : this.getMethod(request),
            disableCaching: false 
        });
        Ext.Ajax.request(request);
        return request;
    }
});

 使用的时候:

proxy: Ext.create("Ext.ux.data.proxy.Ajax",{
				async:false,
				url:"data/SystemMenus.json",
				reader: {
					type: 'json',
					root: 'children',
					idProperty: 'id'
				}
			})

 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics