The $data will have new posted data. If you want to use old data, you will have to execute another sql query that will read table based on posted ID, and fetch data. This is valid for on_update only (before update event).

$data structure can be checked in demos/editing/custom-events.php code.