Re: Changing options when rendering twice datagrid
| From: | Mark Wiesemann | Date: | Fri, 09 Jun 2006 18:26:49 +0000 |
| Subject: | Re: Changing options when rendering twice datagrid | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24309@lists.php.net to get a copy of this message | ||
Hi Michel,
Michel D'HOOGE wrote:
> I am still studying the CVS version of Datagrid and I'm a bit confused
> about initialisation of renderers and options. Is there a clear definition
> of what Structures_DataGrid_Renderer::init() is expected to do?
Hmm, that's clearly stated in Renderer.php:
| Create or/and prepare the container
|
| Drivers may optionally implement this method.
|
| This method is responsible for creating the container if it has not
| already been provided by the user with the setContainer() method.
| It is where preliminary container setup should also be done.
> Especially, if we change some options, what is the expected behaviour?
> I am not fully sure, but if I run the following code, the renderer will
> output twice the same data:
> $datagrid->render(null, array('foo'=>'1');
> $datagrid->render(null, array('foo'=>'2');
Please provide a code example if this does not work for you.
This works for me (not beautiful, but working *g*):
$dg->render(null,
array('headerAttributes' => array('bgcolor' => 'red')));
$dg->render(null,
array('headerAttributes' => array('bgcolor' => 'green')));
Regards,
Mark