繁体   English   中英

替换Ext.data.store的url

[英]replace url of Ext.data.store

我声明了StoreBaseOn ,并且想要更改它的URL,然后加载它,因为我的代码需要这样做。 如何更改URL?

声明的代码:

StoreBaseOn =  new Ext.data.JsonStore({
    url: [myurl],
    root: 'rows',
    idProperty: [myID],
    autoLoad: true,
    remoteSort: true,
    baseParams: [myParam],
    fields: ['id', 'age']
});

我知道如何更改参数,例如StoreBaseOn.setBaseParam('group', the_group); 但是如何仅更改URL?

网址是在商店的proxy中设置的,因此您可以使用以下功能进行设置:

StoreBaseOn.getProxy().setUrl("YouNewUrl");

感谢Ludovic! 可悲的是,我使用ExtJS3.4, getProxy()没有getProxy()方法。 但是,在您的启发下,我想出了如何处理此情况的方法:

StoreBaseOn.proxy.setUrl(myNewUrl)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM