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

 New row in editable grid

Print topic Send  topic

Author Message
szenczi

Posts: 67
Posted: 03/26/2008, 7:05 AM

Hi,

How can I solve it?
I've got an editable grid with an empty row. I'd like to fill automatically the ID field of this empty row. It depends on the result of the editable grid's original query. This ID = biggest earlier value + any value.

Thanks,
Norbert
_________________
CCS5.1, PhP, MySQL
View profile  Send private message
szenczi

Posts: 67
Posted: 03/27/2008, 6:18 AM

I solved the first part of the function (search the biggest and calculate the new value).
But my main problem is how can I refer to the empty row and change the value of this row before inserting?


Thanks,
Norbert
_________________
CCS5.1, PhP, MySQL
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/27/2008, 6:49 AM

You have editable grid with one blank row for new edits.
You have calculated your new ID value by adding 1 to the last known highest value.
Where do you store this value, in a session variable or a textlabel or a hidden field ?

Use the Custom Insert, it allows you to assign values to the Insert coning from various places, session, form, application etc.
Hope this helps.

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/27/2008, 6:50 AM

PS: Why is your ID field not an autoincrement primary key?
That would automaticaly do what you describe.

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
szenczi

Posts: 67
Posted: 03/27/2008, 7:12 AM

It isn't a simple autoincrement primary key, because it depends on certain date(s). I can calculate the correct value programatically but I'd like to show this value in a text field in the empty row before the user fill in the other fields. (It is important to see by the user.)
Can I do this?
_________________
CCS5.1, PhP, MySQL
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/27/2008, 7:45 AM

Yes, you can do this, in various ways.
You statet earlier you have calculated the correct new value, where do you store that?
You could do the calculation BeforeShow(Row), or store it in a sessionvariable, a textlabel.
Then follow the CustomInsert advice.

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
szenczi

Posts: 67
Posted: 03/27/2008, 8:24 AM

The calculation is in the BeforeShow event. The value is in a variable and I would like to show before any submit operation.
_________________
CCS5.1, PhP, MySQL
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.