PDA

View Full Version : getSelectedRecords return the wrong record



Gunny
26 Mar 2011, 9:41 AM
Hi all,

when I use getSelectedRecords, i get the wrong item.
My list is a very simple list and it's grouped.

When the app starts, the store is loaded and getSelectedRecords return the correct value.
When I add a new record with store.add(), the getSelectedRecords function return the wrong value.

It seems that the indexes of the list is not synchronized with the indexes of the records in the store.

Someone have the solution?

StuartAshworth
27 Mar 2011, 2:24 AM
I came across a similar sounding problem a day or two ago and I think you can get around it by adding a Sorter to the Store which seems to reassign the indexing after grouping. I'm not sure how it will work with adding new items but it might be worth a try.

Gunny
28 Mar 2011, 4:11 AM
Exactly,
I do a "fake" sort and the records are reordered correctly.

Thanks