PDA

View Full Version : Store load call with duplicate params issue



parky128
14 Aug 2013, 3:04 AM
Hi, I am calling load on a store and passing in param values like so:


Ext.getStore('JourneyEventStore').load({
params: {
untID: this.getApplication().selectedHistoryUntID,
hujID: record.data.HujID
}
});

But I am finding when making numerous calls to this and passing in new param values, the request that gets fired off contains duplicate params with the various different values I am passing in, e.g.

http://pptouch.pinpointers.com/location/GetJourney.json?FieldSet=1&untID=9085&hujID=44287046&modifiedSince=635120728360000000&_dc=1376477881731&untID=9085&hujID=44285695&page=1&start=0&limit=25

I thought the proxy would overwrite any same named params with the new values passed in each time.

Store code:


Ext.define('PinpointersTouch.store.JourneyEventStore', {
extend: 'Ext.data.Store',

config: {
storeId: 'JourneyEventStore',
proxy: {
type: 'ajax',
url: '/location/GetJourney.json?FieldSet=1',
reader: {
type: 'json',
idProperty: 'HitID',
rootProperty: 'data'
}
},
sorters: {
direction: 'DESC',
property: 'EventDT'
},
fields: [
{
name: 'HitID'
},
{
name: 'Description'
},
{
name: 'EventDT'
},
{
name: 'EventDTDisplay'
},
{
name: 'MinZoom'
},
{
name: 'UrrID'
},
{
name: 'MapIcon'
},
{
name: 'Lat'
},
{
name: 'Lon'
}
]
}
});

Any ideas on what could be causing this?
Thanks

mitchellsimoens
16 Aug 2013, 5:50 AM
I'm not seeing this happen:


var store = new Ext.data.Store({
fields : ['foo'],
proxy : {
type : 'ajax',
url : 'data/php.php',
extraParams : {
sleep : 5
}
}
});

store.load({
params : {
foo : 'bar',
bar : 'foo'
}
});

setTimeout(function() {
store.load({
params : {
foo : 'bar1',
bar : 'foo1'
}
});
}, 2);

I get 2 requests:

http://localhost/test/data/php.php?_dc=1376660984798&foo=bar&bar=foo&sleep=5&page=1&start=0&limit=25
http://localhost/test/data/php.php?_dc=1376660984818&foo=bar1&bar=foo1&sleep=5&page=1&start=0&limit=25

notice foo and bar have the correct values for each load.