PDA

View Full Version : Store sync questions



rondinos
29 Jan 2012, 4:22 PM
Hello,

I have a grid sorted by Date Desc and pageSize: 5
Every time I add a record and I run store.sync() it adds the record to the bottom. It also adds a 6th item on my grid.

I want to keep just 5 records to the grid, and since it's sorted by date, I want new records to go on top. My post and response is correct.

Is there a way to do this ?

I am running 4.0.7 and please do not tell me that this has been fixed in 4.1 b1, because that version has way too many bugs for me.

mitchellsimoens
30 Jan 2012, 7:40 AM
Paging is not done locally, paging is only done remotely so if you add items to the store locally the paging will have no affect.

Izhaki
30 Jan 2012, 7:23 PM
How did you add the new record to the store?

Have you tried:


this.getUsersStore().insert(0, iRecord);

For all I can see it does add an extra record on top of the pageSize. So I guess you'd need to reload your store after adding...