PDA

View Full Version : [CLOSED] MoveLast when PagingToolbar loads



jpadgett
Feb 20, 2013, 11:58 PM
I'm trying to move a paging toolbar to the last page when a gridpanel first loads on a screen.

I did see this post: http://forums.ext.net/showthread.php?16161-Paging-Automatically-move-to-last-record

And I tried this:


.BottomBar(
Html.X().PagingToolbar()
.ID("GamesPager")
.BeforePageText("Game")
.Listeners(l =>
{
l.AfterRender.Handler = "#{GamesPager}.moveLast();";
})
)


But it is not working. I've also tried listening on different events, but have not found one that works.

Any ideas on how I might accomplish this?

Baidaly
Feb 21, 2013, 2:26 AM
Hello!

Try to listen Load event of the Grid's store:


.Listeners(l =>
{
l.Load.Handler = "store.loadPage(Math.ceil(store.totalCount/store.pageSize));";
l.Load.Single = true;
})

Daniil
Feb 21, 2013, 6:19 AM
Hello,

In the case with remote paging, you could set up some parameter into a Store's AutoLoadParams which would mean "load last page" and which you could take into account within a data handler.

jpadgett
Feb 21, 2013, 1:38 PM
Thank you both for the responses.

Daniil - since this particular grid panel is displaying a relatively small record set, I'm not using remote paging. I expect I will have a need for remote paging soon, however, so I will keep your reply in mind. ;)

Baidaly - your listener on the store worked. Thanks.