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|12|Next Results: Viewing items 1-20 of 30.
Person ID First Name Last Name Sorted
Previous|12|Next Results: Viewing items 1-20 of 30.
20 tester 1234
28 34 34
13 jj a
26 nikos aliagas
27 sadf asdf
15 a b
9 Linda Broy
11 Brett Carlisl
17 234 edwe
16 John Forbes
23 Bill Gates
4 Miguel Ho
30 hello how r u
19 jhjh jkj
21 Steve Jobs
8 Samanthahg Jonesssssssss
25 alma korte
2 Kendall ghjh Nix11
12 Jacob Pratt
29 qq qqqqq