CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid field init

Print topic Send  topic

Author Message
Gena
Posted: 10/06/2005, 8:53 AM

How do I initialize a value of some field in Editable Gride from the passed parameters (url)???

I pass product ID and need to put it by default value into one field in Editable Grid.

please help
DonB
Posted: 10/06/2005, 7:50 PM

You can set the value of the 'Product ID" control in the Ed Grid's Before
Show Row event. But be forewarned, if you insert a 'default' value into the
grid, then that row will be inserted into the database. You might not have
intended that to happen. Normal Ed Grid behavior is to only insert when
data fields are filled in via keyboard input. But when you stick in a
default, it thinks the user typed it in and proceeds to do the insert.

$myEdGrid->ProductID->SetValue($mydefaultvalue);

--
DonB

http://www.gotodon.com/ccbth


"Gena" <Gena@forum.codecharge> wrote in message
news:543454886a5dc1@news.codecharge.com...
> How do I initialize a value of some field in Editable Gride from the
passed
> parameters (url)???
>
> I pass product ID and need to put it by default value into one field in
> Editable Grid.
>
> please help
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Gena
Posted: 10/06/2005, 11:59 PM

Quote DonB:
You can set the value of the 'Product ID" control in the Ed Grid's Before
Show Row event. But be forewarned, if you insert a 'default' value into the
grid, then that row will be inserted into the database. You might not have
intended that to happen. Normal Ed Grid behavior is to only insert when
data fields are filled in via keyboard input. But when you stick in a
default, it thinks the user typed it in and proceeds to do the insert.

$myEdGrid->ProductID->SetValue($mydefaultvalue);
Thanks for the input, DonB!
Yes, you are right about "insert a 'default' value into the grid", but as a wrote I have Master-Detail pages so I need to fill primary field in the Detail page (which is Ed Grid). I pass primary field value via url parameter and what should be the code to get it ?? like ths??
$mydefaultvalue = get from url ......
$myEdGrid->ProductID->SetValue($mydefaultvalue);

I am newbie in CCS and php, so just let me know everything what could be helpful.

Gena
peterr


Posts: 5971
Posted: 10/07/2005, 12:13 AM

Take a look at the "Master-Detail Form for Order Entry" example in CCS Example Pack. It does exactly the same thing based on what I understood from your description. In the "Before Build Insert" event code I see this:
	$order_id = intval(CCGetFromGet("order_id",0));  
	if($order_id >0){  
		$store_orders_items->ds->order_id->SetValue($order_id);  
  	}
You can probably analyze and play with that example to understand exactly how it works.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Gena
Posted: 10/07/2005, 1:39 AM

Quote peterr:
Take a look at the "Master-Detail Form for Order Entry" example in CCS Example Pack. It does exactly the same thing based on what I understood from your description. In the "Before Build Insert" event code I see this:
	$order_id = intval(CCGetFromGet("order_id",0));  
	if($order_id >0){  
		$store_orders_items->ds->order_id->SetValue($order_id);  
  	}
You can probably analyze and play with that example to understand exactly how it works.

Great! thanks!!

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.