CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Highlight currently selected row

Print topic Send  topic

Author Message
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

View profile  Send private message
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
View profile  Send private message
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!!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.