oasisp
Posts: 48
|
Posted: 04/07/2017, 2:31 PM |
|
i have Editable Grid with delete checkbox.
so user can select multiple checkbox to delete items from table(grid).
i need logged before user delete items from table. BeforeExecuteDelete
basically i need items user selected only for delete. items to delete on editable grid insert on new table for logging.
dont know how to implement on BeforeExecuteDelete. appreciate your help
|
|
|
MichaelMcDonald
Posts: 640
|
Posted: 04/25/2017, 12:22 AM |
|
It''s $db connection heavy but you can use the on validate row to get the checkbox value and any field from the row and insert those values into a table.
_________________
Central Coast, NSW, Australia.
|
|
|
eratech
Posts: 513
|
Posted: 08/31/2017, 1:10 AM |
|
@oasisp - you can certainly do it with the BeforeExecuteDelete to collect the values from the form and executing some Custom SQL to put it in the table. This will execute once for each ticked row. The correct 'row' detail will be collected so you don't need to keep track.
(this isn't working code but should give a pointer)
function EditableGrid_ds_BeforeExecuteDelete
$EditableGrid_ds_BeforeExecuteDelete = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $EditableGrid; //Compatibility
// get the values from the Edittable Grid and add them to the Custom SQL
$db = new clsDBConnection1();
$SQL = "INSERT INTO backuplog (status, userid) ".
"VALUES (". $db->ToSQL($Container->status->GetFormattedValue() ,ccsInteger) .",". $db->ToSQL(CCGetUserID(),ccsInteger) .")";
$db->query($SQL);
$db->close();
}
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
|