Structures
| From: | Ian Warner | Date: | Sun, 01 Apr 2007 18:43:47 +0000 |
| Subject: | Structures | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-26965@lists.php.net to get a copy of this message | ||
Hi
I want to override the colour being set within a HTML rendered structure for a certain row only.
I have currently:
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
// Set up the renderer options.
$datagrid->setRendererOptions(array(
'buildFooter' => false, 'buildHeader' => true,
'encoding' => 'UTF-8', 'hideColumnLinks' => array('actions'),
'extraVars' => array('test' => 'test'),
'numberAlign' => false, 'selfPath' => $path,
'evenRowAttributes' => array('style' => 'cursor: pointer;', 'onMouseOver' => 'this.style.backgroundColor=\'#eeeeff\'',
'onMouseOut' => 'this.style.backgroundColor=\'#FFFFFF\'', 'bgcolor' => '#FFFFFF'),
'oddRowAttributes' => array('style' => 'cursor: pointer;','onMouseOver' => 'this.style.backgroundColor=\'#eeeeff\'',
'onMouseOut' => 'this.style.backgroundColor=\'#EEEEEE\'', 'bgcolor' => '#EEEEEE'),
'sortIconASC' => '⇑', 'sortIconDESC' => '⇓',
'sortingResetsPaging' => true
));
If a row contains the words IN or OUT though I want the colour to be highlighted differently - not all rows may contain this though.
I have flirted with something along the following, but feel I am missing something obvious.
if (isset($options['colours'])) {
foreach ($datagrid->recordSet as $k => $v) {
if ($k[key($options['colours'])] = $options['colours']['way']) {
//echo $bgcolor = $options['colours']['way'][];
}
}
}
So basically how would you go about overiding the default colour of a row if it contains certain elements
My calling script has this array:
So column WAY if it has the value IN or OUT so the row colour to the value.
$options['colours'] = array('way' => array('OUT' => 'yellow', 'IN' => 'red'));
Regards
Ian
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s