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

 Skipping update of unchanged rows in editable grid

Print topic Send  topic

Author Message
jacem

Posts: 87
Posted: 08/25/2008, 7:05 PM

There are a few posts related to this problem however I don't feel I have found a solution that works for me:

I have an editable grid that allows both updates and inserts. If a user creates a new record or updates an existing record I have the 'dateupdated' field automatically being updated in the 'Custom Update' with the PHP expression time(). However I discovered, as others have in various posts on this fourm, that CCS3.x re-saves every displayed editible grid row whether the row has changed or not, when the user presses submit. Obviously it would have been a better event implementation, as in other areas of CCS, that the update only gets called if there is something changed to be saved for each individual row in the grid.

I have code in the onvalidaterow that detects that only updatable field has been changed (by comparing the current valid of the control with a hidden oninit populated copy of the control) and I have tried various methods to turn off the record save for that row: UpdateAllow=false etc...:

function prospectsegments_OnValidateRow(& $sender)
{
$prospectsegments_OnValidateRow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $prospectsegments; //Compatibility

$seg1 = $Container->SegmentID->GetValue();
$seg2 = $Container->previoussegmentid->GetValue();

if ($seg1<>$seg2) {
//something changed...better update the time & bywho
$Container->UpdateAllowed=True;
$prospectsegments->UpdateAllowed=True;
} else {
$Container->UpdateAllowed=False;
$prospectsegments->UpdateAllowed=False;
}
}

I have checked that the test is working with the test data.

I have also tried taking the time() out of the custom update for the dataupdated field and tried setting the time during the onvalidaterow event however it seems ccs triggers are not set up for controls do be modified during the onvalidaterow event -0 the change is ignored during the update.

While I am not a newbie with CCS, I am no expert. Same with PHP so please be gentle.

Any pointers would be appreciated.

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.