Tip 1
If you want to pass extra params to store there are two ways to do that.
1) Pass it in load method.
store.load({
params: {
param1 : value1
}
});
2) Set it as extra param.
store.getProxy().setExtraParams({
‘param1’ : value1,
‘param2’: value2
});
So what’s the difference between this two and when to use which.
When you have requirement to add and use params only once. Also every time store load, you want to pass different params you have to use below method.
store.load({
params: {
param1 : value1
}
});
Params added here are only added once. Next time when you call load method of store, these params are not passed. You can use it for dynamic parameters.
When you have fixed params that you have to pass every time, a store is loaded. You have to use following method.
store.getProxy().setExtraParams({
‘param1’ : value1,
‘param2’: value2
});
This will permanently add those params to the store and it will be passed every time store.load() method is called.