CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 row counter PHP

Print topic Send  topic

Author Message
sanit
Posted: 04/30/2005, 7:35 AM

Dear,

I want to display row counter in grid column by variable and I found sample in rexdesign below :


Row Counter in CCS :

Insert Label (Toolbox-Form-Label) where you need the number
Name it myLabel (just for example)
Add Event BEFORE SHOW for this Label
Use code below (PHP but the logic is easy in any language)

//BEGIN CUSTOMCODE

global $myGridName;
global $myCounter;

if (empty($myCounter)) {
$myCounter = 1;
} else {
$myCounter++;
}

$myGridName->myLabel->SetValue($myCounter);

These code work for display row counter each page,Example page size = 15 ,display row counter 1 to 20 every page.But I need to display row counter continue until end of file not reset to 1 for new page.Please help me any idea.

Thanks in advance,

Sanit.



sanit
Posted: 05/01/2005, 8:17 AM

I found the way to get pagesize and pagenumber to calculate row number.Thank you.

Sanit.
:-)
PeterJ


Posts: 90
Posted: 05/01/2005, 8:50 AM

Would you post the solution please to assist others?

Thanks
View profile  Send private message
sanit
Posted: 05/01/2005, 7:28 PM

Dear peterj,

Below is my coding in before show row of grid "asset_master" and I extend idea from rexdesign.I wish .0 have feature row ID.

global $nr;
$n=CCGetFromGet("asset_masterPage");
$p=$asset_master->PageSize;
if($n<=1){
if(empty($nr)){
$nr=1;
}else{
$nr++;
}
}else{
$no=(($n*$p)-$p);
if(empty($nr)){
$nr=$no+1;
}else{
$nr++;
}
}

$asset_master->Label1->SetValue($nr);

Sanit.

sanit
Posted: 05/01/2005, 7:38 PM

Dear peterj,

Here is complete reply.

Below is my coding in before show row of grid "asset_master" and I extend idea from rexdesign.I wish .0 have feature row ID.

global $asset_master;
global $nr;
$n=CCGetFromGet("asset_masterPage");
$p=$asset_master->PageSize;
if($n<=1){
if(empty($nr)){
$nr=1;
}else{
$nr++;
}
}else{
$no=(($n*$p)-$p);
if(empty($nr)){
$nr=$no+1;
}else{
$nr++;
}
}

$asset_master->Label1->SetValue($nr);

Sanit.
PeterJ


Posts: 90
Posted: 05/02/2005, 1:11 AM

Many thanks Sanit
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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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