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

View Source
will open in a new window
Customizing the QDataGrid subclass
All QDataGrids, by default, can be customized by altering the QDataGrid custom subclass in /includes/qform/QDataGrid.inc. This class extends from the QDataGridBase class which is in the Qcodo core.

In the subclass, you can feel free to override rendering methods, including GetPaginatorRowHtml, GetHeaderRowHtml, GetDataGridRowHtml and GetFooterRowHtml.

In our example below, we have defined a PaginatorAlternate (so that we can render 2 paginators for this single datagrid), then set ShowFooter to true, and then finally implemented our own custom GetFooterRowHtml method (which basically just calls GetPaginatorRowHtml with the PaginatorAlternate object.
Previous|1|Next Results: Viewing items 1-19 of 19.
Person ID First Name Last Name Sorted
Previous|1|Next Results: Viewing items 1-19 of 19.
16 asd asd
9 Linda Brady
19 df df
1 Teo Dirac
4 Mike Ho
2 Kendalll Jenner
6 Wendy jose
18 kalle kula
12 Jacob Pratt
8 Samantha prueba
3 Ben Robinson
17 sdfsdf sdfsdfsdf
5 Alejnadro Smith
10 Jennifer Smith
11 Brett Smiths
13 wdt t
14 w w
7 Karen Wolfe
15 w wwwgggggggg