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 |