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

 Calling Data from another grid on same page

Print topic Send  topic

Author Message
ckroon

Posts: 869
Posted: 03/24/2008, 9:34 PM

OK. I have it down so I can do some funky stuff on a label or hidden field within a grid.

I have a grid: Grid 1 and I want to add to label vales together and display it in Displaylabel.

$grid1->Displaylabel->SetValue($grid1->Label1->GetValue() + $grid1->Label2->GetValue() );

Easy.

But what if I have another grid on that same page. Grid 2, and I want to pull the Label1 and LAbel 2 data from it and have it display in Grid 1.

$grid1->Displaylabel->SetValue($grid2->Label1->GetValue() + $grid2->Label2->GetValue() );

Doesn't work.. non defined object. I know I am missing something simple... Karma to the first one to point it out to me. What is the code to tell it look at the current page, find Grid 2 and return those vales?

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
aondecker

Posts: 58
Posted: 03/25/2008, 4:14 AM

Quote ckroon:
OK. I have it down so I can do some funky stuff on a label or hidden field within a grid.

I have a grid: Grid 1 and I want to add to label vales together and display it in Displaylabel.

$grid1->Displaylabel->SetValue($grid1->Label1->GetValue() + $grid1->Label2->GetValue() );

Easy.

But what if I have another grid on that same page. Grid 2, and I want to pull the Label1 and LAbel 2 data from it and have it display in Grid 1.

$grid1->Displaylabel->SetValue($grid2->Label1->GetValue() + $grid2->Label2->GetValue() );

Doesn't work.. non defined object. I know I am missing something simple... Karma to the first one to point it out to me. What is the code to tell it look at the current page, find Grid 2 and return those vales?


try defining grid2 as global since most likely your custom code is in the Grid1 component.

global $grid2;
$grid1->Displaylabel->SetValue($grid2->Label1->GetValue() + $grid2->Label2->GetValue());

that should probably do it
View profile  Send private message
ckroon

Posts: 869
Posted: 03/25/2008, 2:52 PM

That was it! Thanks :-D
_________________
Walter Kempees...you are dearly missed.
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.