ExtJS4存储代理网址覆盖 [英] ExtJS4 store proxy url override
本文介绍了ExtJS4存储代理网址覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过更改代理网址(实际端点而不是参数)来重用存储。可以使用以下语法覆盖商店实例的代理网址:
I am trying to reuse a store by altering proxy url (actual endpoint rather than params). Is it possible to override proxy URL for a store instance wih the following syntax:
{
...some view config ...
store: Ext.create('MyApp.store.MyTasks',{proxy:{url:'task/my.json'}}),
}
如果代理在Store定义上已经定义好了,
if proxy is already well defined on the Store definition?
strong> EDIT :AbstractStore源代码集代理以下方式
EDIT: AbstractStore source code sets proxy the following way
if (Ext.isString(proxy)) {
proxy = {
type: proxy
};
}
解决方案:store.getProxy()。url ='task / myMethod.json';
SOLUTION : store.getProxy().url = 'task/myMethod.json';
推荐答案
{
... some tab config ...
store: Ext.create('MyApp.store.MyTasks'),
listeners: {
afterrender: function(tab) {
tab.store.getProxy().url = 'task/myMethod.json'; //<--Saki magic :)
tab.store.load();
}
}
}
http://www.sencha.com/forum/showthread.php ?149809-重用 - 存储 - 更改 - 代理URL
这篇关于ExtJS4存储代理网址覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文