sunmoonone
26 Jan 2010, 7:15 PM
May be I should start a new thread for this sticky bug.
When call store.load and I do override(add or set) the baseParams of an instance of Ext.data.Stroe in the callback of the 'beforeload' event.
But new params I set can not be post to the server.
I checked the source code of 3.0 and 3.1.0 and found a big different procedure when overriding the options.params:
In 3.0:
new params is applied just before the request:
if (doRequest !== false) {
// Send request to proxy.
var params = Ext.apply({}, options.params, this.baseParams);
But in 3.1.0 the params is set too early, It is set even before firing the 'beforeload' event:
if (action === 'read') {
Ext.applyIf(options.params, this.baseParams);
doRequest = this.fireEvent('beforeload', this, options);
}
I think it is the very reason why new params set to store.baseParams can not be sent to the server.
When call store.load and I do override(add or set) the baseParams of an instance of Ext.data.Stroe in the callback of the 'beforeload' event.
But new params I set can not be post to the server.
I checked the source code of 3.0 and 3.1.0 and found a big different procedure when overriding the options.params:
In 3.0:
new params is applied just before the request:
if (doRequest !== false) {
// Send request to proxy.
var params = Ext.apply({}, options.params, this.baseParams);
But in 3.1.0 the params is set too early, It is set even before firing the 'beforeload' event:
if (action === 'read') {
Ext.applyIf(options.params, this.baseParams);
doRequest = this.fireEvent('beforeload', this, options);
}
I think it is the very reason why new params set to store.baseParams can not be sent to the server.