user760955
user760955

Reputation:

Paging toolbar refresh equivalent

This should be very simple but I don't have any solution yet. I am using a ExtJs v.3.3.1

I have a grid panel that allows record deletion. The grid has a paging toolbar that is attached to the panel store.

The deletion process sends an ajax request to the server, on success I remove the record from the Db which is used for displaying record in the grid.

My problem is that when I delete a record it sometimes shows effect immediately but sometime doesn't. that is record is deleted from DB but from grid panel it doesn't get erased immediately sometimes. but when I click refresh button it shows current state of DB that everything works fine everytime.

I have used Ext.getCmp('id-pagingtoobar').doRefresh() to show immediate effect but this doesn't works every time.

Anybody has solution for this?

Upvotes: 2

Views: 9310

Answers (2)

Sapan Diwakar
Sapan Diwakar

Reputation: 10946

There might be problem in order in which requests are sent. I suggest you to send these request in order using

callback:function () {
      Ext.getCmp('id-pagingtoobar').doRefresh()
}

Upvotes: 1

JamesHalsall
JamesHalsall

Reputation: 13475

I always refresh the grid store after a delete or insert operation so the user is working on a live data set...

grid.store.reload()

This also updates your paging toolbar automatically

Upvotes: 5

Related Questions