Home > Archive > PHP Pear > May 2007 > question about Structures_DataGrid
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
question about Structures_DataGrid
|
|
| Anton Tobolchenko 2007-05-15, 8:02 am |
| Hi, I am a web programmer from Russia.
First of all, excuse my bad english =)
I have a question about *Structures_DataGrid* class.
I read documentation on
http://pear.php.net/manual/en/packa...grid-datasource
but
i didn't understand how it work.
Please, help me.I think that i will understand all, if i saw a correctly
code.
For example, lets take such task: create table with 2 columns and 3 rows.
First - checkboxes and secont - simple static text (not edit).
In the beginning we have array with data. And table we need to build on that
array (take from array information about which checkbox is checked and what
is the static text will be near it). Which php code will generate such
table if we a using pear *Structures_DataGrid* class?
Please, write all code from "<?php" till "?>".
I hope you will understand my problem and will help me.
| |
| Mark Wiesemann 2007-05-15, 8:02 am |
| Hi,
Anton Tobolchenko wrote:
> Hi, I am a web programmer from Russia.
> First of all, excuse my bad english =)
> I have a question about *Structures_DataGrid* class.
> I read documentation on
> http://pear.php.net/manual/en/packa...grid-datasource
> but
> i didn't understand how it work.
> Please, help me.I think that i will understand all, if i saw a correctly
> code.
> For example, lets take such task: create table with 2 columns and 3 rows.
> First - checkboxes and secont - simple static text (not edit).
> In the beginning we have array with data. [...]
This can be achieved by the code that you've sent yesterday. Just
correct it (I gave you the needed hints in my answer) and you're done.
> And table we need to build on that
> array (take from array information about which checkbox is checked and what
> is the static text will be near it). Which php code will generate such
> table if we a using pear *Structures_DataGrid* class?
If you want to have the checkbox next to the text in one column, you
need a column formatter. Explaination and examples can be found in the
manual:
http://pear.php.net/manual/en/packa...d.formatter.php
http://pear.php.net/manual/en/packa...le-advanced.php
If you want to have a separate checkbox column, our new
CheckableHTMLTable renderer might be interesting for you. It can be
found in CVS. (This renderer is still in development, its name and code
might change prior to a first official release.)
Regards,
Mark
--
http://www.markwiesemann.eu
|
|
|
|
|