简体   繁体   English

ext-js动态更新参数

[英]ext-js update params dynamically

I'm building a search using ext-js. 我正在使用ext-js建立搜索。 I have an event that fires on keyup. 我有一个在键盘启动时触发的事件。 I want to be able to change either the URL I'm searching, or the params. 我希望能够更改正在搜索的URL或参数。 I've had luck with neither. 我都没有运气。

Here's my snippit of code: 这是我的代码片段:

Ext.get("search").on('keyup', function() {
proxy.url = '/customer/list?key=' + $('search').value;
store.load();
});

But, no love for me. 但是,对我没有爱。 The store loads, but the proxy.url is the old value. 存储已加载,但是proxy.url是旧值。 Is what I'm trying to do possible? 我想做的事可能吗?

Thanks in advance! 提前致谢!

You'd probably want to use the proxy.setUrl() method instead which internally updates the connection. 您可能想使用proxy.setUrl()方法来内部更新连接。 If changing the params is sufficient, you could also try passing the params config into the load call, eg, store.load({params: {...}}); 如果更改参数已足够,您还可以尝试将参数配置传递到load调用,例如, store.load({params: {...}});

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

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