tags:

views:

174

answers:

2

I have a YUI Datatable which is paginated. The height the datatable is able to use can change. What I want to happen is that when there is a size change (which I already have a handle on), I can take the new height and find how many rows are going to fit in a page, then change the datatable or it's paginator to have that number of rows.

Is this something that is possible with YUI Datables, if so is there examples or documentation about it?

A: 

It appears that if you can get a reference to the YAHOO.widget.Paginator instance, you can call:

theTablesPaginator.setRowsPerPage(numRows, silent)

Where the silent option allows setting whether the changeRequest event should be sent. If you wish the datatable to redrawn, set this to false.

Reference: the very useful official YUI documentation

Grundlefleck
+2  A: 
myDataTable.get('paginator').setRowsPerPage(25);
Luke