PDA

View Full Version : Store not appending...



zquirm
2 May 2007, 11:06 AM
I find that every time I execute store.load() it doesn't append the loaded data into to my current set of data even though I have "append:true"


this.store = new Ext.data.Store({
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: 'script/get-events.asp'
}),

// create reader that reads the Topic records
reader: new Ext.data.JsonReader({
root: 'events',
id: 'id'
}, [
{name: 'title', mapping: 'title'},
{name: 'startMonth', mapping: 'startMonth', type: 'int'},
{name: 'startMonthName', mapping: 'startMonthName'},
{name: 'startDay', mapping: 'startDay', type: 'int'},
{name: 'startYear', mapping: 'startYear', type: 'int'},
{name: 'startHour', mapping: 'startHour', type: 'int'},
{name: 'startMinute', mapping: 'startMinute'},
{name: 'startAMPM', mapping: 'startAMPM'},
{name: 'endMonth', mapping: 'endMonth', type: 'int'},
{name: 'endMonthName', mapping: 'endMonthName'},
{name: 'endDay', mapping: 'endDay', type: 'int'},
{name: 'endYear', mapping: 'endYear', type: 'int'},
{name: 'endHour', mapping: 'endHour', type: 'int'},
{name: 'endMinute', mapping: 'endMinute'},
{name: 'endAMPM', mapping: 'endAMPM'},
{name: 'cls', mapping: 'cls'},
{name: 'tip', mapping: 'tip'}
]),
});

this.store.load({params:{
uid:uid,
start:this.activeDate.format('n/j/Y'),
end:this.activeEndDate.format('n/j/Y')}
,append:true,
datesLoaded:this.datesLoaded,
callback:this.storeDates,
scope:this});



thoughts?

jsakalos
2 May 2007, 11:46 AM
I believe append is another boolean argument to the load call not the part of load config object.

jsakalos
2 May 2007, 11:48 AM
Sorry, I was looking at the loadData method...

tryanDLS
2 May 2007, 2:01 PM
I don't think that's correct. Try this


this.store.load({add:true,
params:{
uid:uid,
start:this.activeDate.format('n/j/Y'),
end:this.activeEndDate.format('n/j/Y')}
datesLoaded:this.datesLoaded,
callback:this.storeDates,
scope:this}
});

zquirm
2 May 2007, 2:55 PM
yup...Tim, that was it. thanks! that needs to be changed in the documentation...it says "append"

tryanDLS
2 May 2007, 3:45 PM
The doc is fixed in SVN.