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

 Modify Fields in Grid

Print topic Send  topic

Author Message
maxhugen

Posts: 272
Posted: 03/29/2008, 10:29 PM

I created a non-editable Grid that displays client details. As the grid was getting too wide, I decided to change the query to concat() 2 fields: Address1 and Address2. I aliased the concatenated field as 'Address'.

Then in HTML view, I deleted the Address2 sorter, and edited the Sorter for Address1 to Address. No good - CCS no longer recognised this as a Sorter. So I deleted that line, and re-added it using the Sorter control under 'Forms' in the Toolbox. Seemed OK, but it didn't display in LivePage.

So I checked the Code view, and noticed that the variable for the Grid Control wasn't there (should look like public $Sorter_Address;). Appropriate code for this Sorter is also missing from other sections of the code.

Regenerating the code isn't helping. I tried manually adding the apparently missing code, but managed to screw something up, the page won't display at all now.

Is it not possible (or not advisable) to try to edit a Grid once created?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/30/2008, 6:21 AM

Of course you can edit/change the layout and or content of the grid.
What you probably should have done was:

Taking it from the generated grid,
in VQB, change the address1 to concat(adress1 and address2) setting that fields alias to Address1.
You would have ended up with a concatenated field and a (still) working sorter.

So If you can, just delete the grid, and recreate it using the builder then apply above tip.

I could explain another approach but, hey, it's Sunday.

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
maxhugen

Posts: 272
Posted: 03/30/2008, 4:23 PM

Didn't know that MySQL would allow an alias with the same name as a Column. MS Access doesn't, as its engine complains about a circular reference. Besides, its not something I'd like to do anyway.

Cheers
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 03/30/2008, 8:33 PM

Aha, nice question.
Consider this
The default generated SQL in VQB would generate in the FIELDS window
Address1
Address2
(implicit aliased fieldnames)
You then change:
Concat(Address1,Address2) alias Address1

And fool VQB into thinking nothing has changed.
I do this (being a fool) all the time!

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

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.