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 QCubed
internally
as delimiters on when the PHP engine should be used.
QDataGrid
(and QCubed 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 "kavita 2"
arulyfred
First Name is "Kendall2"
Publics
First Name is "Ben"
5665564
First Name is "Mike"
Ho
First Name is "Alex"
Smith
First Name is "Wendy"
Smith
First Name is "Karen"
Wolfe
First Name is "Samantha"
Jones
First Name is "Linda"
Brady
First Name is "Jennifer"
Smithfgfg
First Name is "Brett"
Carlisle j
First Name is "Jacob"
Pratt
First Name is "sdf"
sdf
First Name is "sdhgfhsdg"
jai
First Name is "billy"
wilder
First Name is "Nice"
Job
First Name is "good"
job
First Name is "moi"
tpo77
First Name is "test"
test