CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Editable Grid with data from another table

Print topic Send  topic

Author Message
buzz


Posts: 11
Posted: 04/01/2004, 12:46 PM

This may be a silly question but I have tried to get this to work but to no avail.

I have three tables

table one is as follows:
Social (Key)
Name

table two has:
Social (Key)
Skill_Name

Table three has:
wkid (key)
Social
Accepted

What I am trying to do is have and editable grid that updates table three.

I am trying to have fields on the editable grid filled in by selecting the Social and name from Table one based on a search of matching social and skill from table two. For ease of locating employees by name.

In the end I am after a way of presenting a list of names in an grid formation that have the fields Social and accepted that if checked update table three.

I have managed to get the data displaying correctly in an editable grid but the grid thinks that it needs to do an update rather than an insert.(we would only be inserting)

Table three is used to track the number of times an employee accepts or declines a job.

I know that this could be done in other ways, but have found these to be to cumbersome and time consuming when we have to call a large number of people and thought that having a page that as we call we could mark accordingly and not have to re-search for the next name on the list.

Any thoughts or advise would be great.


View profile  Send private message
peterr


Posts: 5971
Posted: 04/01/2004, 5:25 PM

Since no one else responded yet, I think that if the Grid displays some information then it seems natural that these records will be updated. By default they should not be inserted as new records since they are not new (based on the fact that some data is being displayed there).
However, if I understand your question correctly then possibly you could trick the Update procedure to do something else than it's intended to do.
I don't program in PHP too much, but looking at the generated code for the Editable Grid in one of our examples I can see the following code:
        $this->SQL = "UPDATE departments SET "  
             . "department_name=" . $this->ToSQL($this->department_name->GetDBValue(), $this->department_name->DataType) . ", "  
             . "department_manager_id=" . $this->ToSQL($this->manager_id->GetDBValue(), $this->manager_id->DataType);  
        $this->SQL = CCBuildSQL($this->SQL, $this->Where, "");  
        $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate");

Therefore it looks like in the "Before Execute Update" event you can alter or replace the SQL statement with your own. Here is also information about how to alter the SQL dynamically: http://docs.codecharge.com/studio/html/Components/RTProperties/PHP/SQL.html

Possibly this will help, although probably you'd need to analyze some of the generated code to figure out what SQL you actually want to execute instead of the one being generated.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
buzz


Posts: 11
Posted: 04/02/2004, 4:19 AM

Thanks Peter
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.