I am using a local store for my grid with a pagingscrollbar. I am having a delete button for which onClick function is written, which does the delete operation(by calling a servlet) from the database. Now once this delete is performed i would like to delete the record from my grid.
I am achieving this using following line:
myStore.removeAt(recIdx);
This removes the record from the grid but when i navigate using the pagination bar next or previous button, the record that was removed is again displayed in the grid. I think its because my store is local, but I am not sure.
Is there a way to overcome this condition???? (I want to keep my store as ‘local’ only)
Thanks!!!
It’s not your local store.
The scrolling pager uses prefetching so as not to have to render all data at once.
The problem is probably because the record you deleted is still in the prefetched data. You could try clearing out the prefetched data where you perform the delete operation:
Actually just deleting that one record from the prefetched data might work better. But you wouldn’t be able to remove it using the index number because there is only a chunk of the actual store in the prefetch data. You would have to use the remove method with the record’s
Ext.data.Modelas a parameter instead: