rickielee
Posts: 9
|
Posted: 09/28/2007, 7:08 AM |
|
Hi there
Can someone tell me how I can highlight (= different <TD> background color) of the currently selected row in a grid?
Problaby somehow with "BeforeShowRow()" code... But how do I check/test for selected row in the dataset?
Thx
|
|
|
datadoit.com
|
Posted: 09/28/2007, 7:20 AM |
|
rickielee wrote:
> Hi there
>
> Can someone tell me how I can highlight (= different <TD> background color) of
> the currently selected row in a grid?
>
> Problaby somehow with "BeforeShowRow()" code... But how do I check/test for
> selected row in the dataset?
>
> Thx
>
>
> ---------------------------------------
'Selected' meaning what? A checkbox selected in the row? Or, mouseover
row highlighted? Or, grid at the top of the page, record detail at the
bottom of the page, and selected record row from the grid?
This info will determine whether this needs to be a client-side or
server-side event.
|
|
|
rickielee
Posts: 9
|
Posted: 09/28/2007, 7:42 AM |
|
Sorry for not specifying correctly. It is as you said:
...grid at the top of the page, record detail at the
bottom of the page, and selected record row from the grid...
Thx
|
|
|
datadoit.com
|
Posted: 09/28/2007, 8:15 AM |
|
rickielee wrote:
> Sorry for not specifying correctly. It is as you said:
>
> ..grid at the top of the page, record detail at the
> bottom of the page, and selected record row from the grid...
>
> Thx
> ---------------------------------------
Okay, if you're familiar with setting template variables, set one for
the row style. In your HTML:
<tr style="{rowStyle}">
In your BeforeShowRow event:
global $Tpl;
if ($Container->ds->f("id") == CCGetParam("id", "")) {
$Tpl->SetVar("rowStyle", "bgcolor='RED'");
}
else {
$Tpl->SetVar("rowStyle", "bgcolor='WHITE'");
}
Where "id" is your link parameter to show the record detail. Note that
if you have any other inline styles in your <TD>'s, those will override
what's in your <TR>. You could just set your <TD> style also as such:
<td style="{dataStyle}">
|
|
|
rickielee
Posts: 9
|
Posted: 09/30/2007, 11:19 AM |
|
Worked like a charme...
Thx!!
|
|
|
|