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.