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'
}
})
本文介绍了一个 Ext.ux.data.proxy.Ajax 的自定义实现,该实现允许同步请求并支持 JSON 数据读取。通过配置示例展示了如何使用此自定义代理加载指定 URL 的 JSON 数据。
139

被折叠的 条评论
为什么被折叠?



