7. Paginated Controls
* Basic QDataGrid
<< Previous   |   Back to Main   |   * The QDataGrid Variables >>

View Source
will open in a new window
An Introduction to the QDataGrid Class
The QDataGrid control is used to present a collection of objects or data in a grid-based (e.g. <table>) format. All QDataGrid objects take in a DataSource, which can be an array of anything (or in our example, an array of Person objects).

In defining a QDataGrid, you must define a new QDataGridColumn for each column in your table. For each QDataGridColumn you can specify its name and how it should be rendered. The HTML definition in your QDataGridColumn will be rendered directly into your HTML output. Inside your HTML definition, you can also specify PHP commands, methods, function calls and/or variables which can be used to output item-specific data.

Calls to PHP can be made by using <?= and ?> tags (see this example's code for more information). Note that these PHP short tags are being used by Qcodo internally as delimiters on when the PHP engine should be used. QDataGrid (and Qcodo in general, for that matter) offers full support of PHP installations with php_short_tags set to off.

Finally, the QDataGrid's style is fully customizable, at both the column level and the row level. You can specify specific column style attributes (e.g. the last name should be in bold), and you can specify row attributes for all rows, just the header, and just alternating rows.
First Name Last Name
First Name is "Teo" Dirac
First Name is "Kendalll" Jenner
First Name is "Ben" Robinson
First Name is "Mike" Ho
First Name is "Alejnadro" Smith
First Name is "Wendy" jose
First Name is "Karen" Wolfe
First Name is "Samantha" prueba
First Name is "Linda" Brady
First Name is "Jennifer" Smith
First Name is "Brett" Smiths
First Name is "Jacob" Pratt
First Name is "wdt" t
First Name is "w" w
First Name is "w" wwwgggggggg
First Name is "asd" asd
First Name is "sdfsdf" sdfsdfsdf
First Name is "kalle" kula
First Name is "df" df