View Full Version : Paging toolbar next/previous page broken in latest build?

5 Dec 2006, 8:18 PM
In the latest SVN build, the paging toolbar's next/previous buttons of the PagedGridView seems to be broken.

When clicking on next page, the grid updates with the next page's rows, but the page number remains at 1. When you click on the next page a second time, the page number advances now to page 2, and the grid remains displaying the correct page 2 rows, i.e. the page number advances for every two clicks.

Rolled back to an earlier build and it confirms that this bug was introduced sometime quite recently.

Not sure if anyone else has encountered this problem - will delve deeper into the possible causes later.

6 Dec 2006, 12:19 AM
What DataModel are you using? The code in PagedGtridView is the same.

The DataModel has to


at the end of its loadData method.

This calls

fireLoadEvent: function(){
this.fireEvent('load', this.loadedPage, this.getTotalPages());

In LoadableDataModel, and the PagedGridView subscribes to that in plugDataModel. Check that that event is being fired in your DataModel.

6 Dec 2006, 4:35 AM
Okay, I believe I've found the bug...

In the JSON DataModel (which I'm using), noticed that the later SVN versions actually do a fireLoadEvent() first before executing the callback function.

XML DataModel still retains the same sequence, i.e. callback then fireLoadEvent() - thus I believe should not face the same problem.

Not sure if there was any reason for the swap in the JSON DataModel - or possibly just a cut-n-paste type of bug...

6 Dec 2006, 5:47 AM
Probably best PM Jack when he gets back.

13 Dec 2006, 6:25 AM
This is fixed in SVN btw.

16 Dec 2006, 3:25 AM

is there a patch/workaround for "yui-ext 0.33 RC3" available?



16 Dec 2006, 4:57 AM
Actually, it will be best if you grab the latest and greatest from SVN... :)

Meanwhile, you can workaround the problem by simply modifying the yui-ext js to execute the callback then fireLoadEvent().

16 Dec 2006, 5:05 AM
Thank you :)



17 Dec 2006, 6:25 AM

Just upgraded to 0.33. works again.

Thank you