PDA

View Full Version : store.load() in paging toolbar



Golden.Vulture
17 Apr 2012, 11:03 PM
Hi,

I am trying to server side paging.
So, I have a paging tool bar and a store attached to it :

{
xtype:'pagingtoolbar',
width:500,
store:'SearchResultStore',
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: 'No topics to display',
style:{
background:'LightCyan',
border:"solid 1px LightCyan"
}

}

First thing, The style is not getting set in IE but works for FF.

Second thing, When I click the next and last button on the toolbar it makes a get call with respective start and limit params. Since the toolbar is attached to the store I suppose there is a store.load() call has been made with such parameters
How can I override that store.load() called by paging toolbar in a controller ?? I want to attach a callback to this store.load() and perform some operation.

vietits
18 Apr 2012, 2:25 AM
PagingToolbar does not directly call store.load() but instead it will call:
- store.loadPage(1) for moving to first page
- store.previousPage() which then will call store.loadPage() for moving to previous page
- store.nextPage() which then will call store.loadPage() for moving to next page
- store.loadPage(last) for moving to last page
- store.loadPage(current) for reload current page
store.loadPage() will then call store.read() then store.load().

However, before calling the above methods, PagingToolbar will fire 'beforechange' event. I think you can catch this event to prepare what you would like to do with store.load().