I have the following store:
var store = new Ext.data.Store({
model: 'Result',
proxy: {
type: 'ajax',
extraParams: {search_term : term},
url : 'find.pl'
},
});
How can I change the parameters with which the url is called (ex. search_term) at runtime?
Think about it as -
You don't call the URL. You load the store.
Now, you can specify search_term value whenever you try to load the store using something like -
store.load({
params:{
search_term:'my runtime search term'
}
//other options like a callback function, append/add flag, etc.
});
Assuming that you want to change the parameters after defining the store
variable. It obviously will depend whether Ext.data.Store
allows the parameters to be changed. If it allows then it is as simple as:
store.proxy.extraParams.search_term = //something
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With