Search code examples
yui

YUI pagination find current page


I am using YUI Pagination to show data. How can I populate the default 5th page of my table after updating record of 5th page. And I also need to populate the RowsPerPageDropdown value, used to decide how many records to show per page.

Is there a onChange event for YUI Pagination? Can anyone help me?


Solution

  • Assuming you are using: YAHOO.widget.Paginator

    pageChange Event fired when attribute changes have resulted in the calculated current page changing.

    from: http://developer.yahoo.com/yui/docs/YAHOO.widget.Paginator.html#events

    Used something like this:

    var paginator = new YAHOO.widget.Paginator({ 
      ... options ...
    });
    paginator.subscribe('pageChange',function(){
      ... handle page change event ...
    })