[英]replace url of Ext.data.store
I have StoreBaseOn
declared, and I want to change the URL of it and then load it, as my code need to do so. 我声明了
StoreBaseOn
,并且想要更改它的URL,然后加载它,因为我的代码需要这样做。 How to change the URL? 如何更改URL?
declared code: 声明的代码:
StoreBaseOn = new Ext.data.JsonStore({
url: [myurl],
root: 'rows',
idProperty: [myID],
autoLoad: true,
remoteSort: true,
baseParams: [myParam],
fields: ['id', 'age']
});
I know how to change param eg StoreBaseOn.setBaseParam('group', the_group);
我知道如何更改参数,例如
StoreBaseOn.setBaseParam('group', the_group);
But how to just change the URL? 但是如何仅更改URL?
网址是在商店的proxy
中设置的,因此您可以使用以下功能进行设置:
StoreBaseOn.getProxy().setUrl("YouNewUrl");
Thanks Ludovic! 感谢Ludovic! sadly I use ExtJS3.4 and which does not have
getProxy()
method yet. 可悲的是,我使用ExtJS3.4,
getProxy()
没有getProxy()
方法。 However, by your inspiration, I figured out how to do in my case: 但是,在您的启发下,我想出了如何处理此情况的方法:
StoreBaseOn.proxy.setUrl(myNewUrl)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.