Re: Datagrid access the rows data
| From: | Justin Patrin | Date: | Sat, 01 Apr 2006 08:08:03 +0000 |
| Subject: | Re: Datagrid access the rows data | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23499@lists.php.net to get a copy of this message | ||
On 3/31/06, arnaud sellenet bodin <demental@free.fr> wrote:
> Actually you can't do this, but with a javascript hack you could indeed.
>
> a formatter that returns an output similar to :
>
> '<p
> onload="parent.style.background-color='.$yourcolor.'">$yourcolor</
> p>'
>
Or, perhaps, a formatter which outputs
'<div style="background-color: '.htmlentities($color,
ENT_QUOTES).'">'.$color.'</div>';
> Well the javascript event onload might not be the right one, but you
> can dig in this way.
>
>
> Le 31 mars 06 à 06:52, Mark Steudel a écrit :
>
> > I was wondering if there was a way to access the data in the row, like
> > below. I have a column called color which has a color in it, e.g.
> > #336699,
> > and I want to make the background color of this cell the same color
> > as the
> > data:
> >
> > $dg->addColumn(new Structures_DataGrid_Column('Color', 'color',
> > 'color',
> > array( 'style' => 'background-color: '.color )));
> >
> > Thanks, Mark
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Justin Patrin