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

 Last row in editable grid (RESOLVED)

Print topic Send  topic

Author Message
saseow

Posts: 744
Posted: 08/24/2010, 3:55 AM

I want to put a text field in an editable grid within a Panel but only show it for the last row.

Any ideas how to get the last row and then show the Panel?

I am stuck!
View profile  Send private message
Waspman

Posts: 948
Posted: 08/24/2010, 5:32 AM

count the rows, compare it with total number of records, set a session variable when equal, show panel accordingly ;-)
_________________
http://www.waspmedia.co.uk
View profile  Send private message
saseow

Posts: 744
Posted: 08/24/2010, 5:55 AM

Hi Waspman,

Ok, this sounds reasonable. I can do all of that. Perhaps there is a better way to count rows but this is how I will do it. Any better suggestions, please don't hesitate:

Add a hidden field and update it with a session variable+1. Good?

Thanks Waspman. Really appreciate it!
View profile  Send private message
Waspman

Posts: 948
Posted: 08/24/2010, 6:13 AM

yep that will do it, only just add it to the session, no need for the hidden field.
_________________
http://www.waspmedia.co.uk
View profile  Send private message
saseow

Posts: 744
Posted: 08/24/2010, 6:20 AM

Excellent! Thank you very much.

I will do this tonight and let you know the result.

Really appreciate it! Thanks.
View profile  Send private message
rho


Posts: 85
Posted: 08/24/2010, 9:49 AM

Just my two cents: for counting rows, I use a global variable (at the top of the *_events.php):
$row = 0;

And in the BeforeShowRow() event of the grid, I increment the row counter:
$row+=1;

To show/hide your panel, you can then use something like this in the BeforeShowRow() event:
$sender->MyPanel->Visible = ($row<$numrecords);

Where and how you determine $numrecords depends on your grid implementation.

Cheers, Rob.
View profile  Send private message
saseow

Posts: 744
Posted: 08/24/2010, 9:35 PM

Thanks Waspman and thanks Rob!

Works perfectly!
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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