7. Paginated Controls
* Simple QDataRepeater using AJAX-triggered Pagination
<< * Enabling AJAX on the QDataGrid   |   Back to Main   |   * Creating Your Own Custom QDataGrid Subclass >>

View Source
will open in a new window
Simple QDataRepeater using AJAX-triggered Pagination
The main difference between a QDataGrid and a QDataRepeater is that while a QDataGrid is in a table and has a lot structure to help define how that table should be rendered, a QDataRepeater is basically without structure. You simply specify a template file which will be used to define how you wish each Person object to be rendered.

This very simple QDataRepeater has a QPaginator defined with it, and its UseAjax property set to true. With this combination, the user will be able to page through the collection of Person items without a page refresh.

Note that because the QPaginator is rendered by the form (as opposed to the example with QDataGrid where the datagrid rendered the paginator), we will set the form as the paginator's parent.

Also, note that QDataRepeater allows you to set two paginators: a Paginator and a PaginatorAlternate. This is to offer listing pages which have the paginator at the top and at the bottom of the page. The same variables of $_FORM, $_CONTROL and $_ITEM that you would have used with a QDataGrid are also available to you in your QDataRepeater template file.
Previous|1234|Next
Person #1
First Name: Teo
Last Name: Dirac
Person #2
First Name: Kendalll
Last Name: Jenner

Person #3
First Name: Ben
Last Name: Robinson
Person #4
First Name: Mike
Last Name: Ho

Person #5
First Name: Alejnadro
Last Name: Smith
Person #6
First Name: Wendy
Last Name: jose


Previous|1234|Next