I’m using a button in ListOptions_Rendered like this:
$this->ListOptions->Items[“new”]->Body = "<a href="#" onclick="return ew.submitAction(event, {action: ‘confirmbooking’, method: ‘ajax’, msg: ‘Confirm this booking? You cannot undo afterwards.’, key: " . $this->keyToJson(true) . “});">Confirm”;in the Row_CustomAction I update data in the row like this:
if ($action == “confirmbooking”) { // Check action name
$rsnew = [“booking_confirmed” => “1”]; // Array of field(s) to be updated
$result = $this->update($rsnew, "subscription_id = " . $row[“subscription_id”]); // Update the current record only (the second argument is WHERE clause for UPDATE statement)
}Although the server data has changed, the displayed data does not update.If I change the call method to: … method: ‘postback’, …
then I get the entire page refreshed.Is there a way to update only the changed row?
Currently, it is not supported by the built-in feature.
However, you may use “ListOptions_Load” and “ListOptions_Rendered” server events to add your custom button in each row, but not use “Row_CustomAction” server event. For the replacement of Row_CustomAction, you may use AJAX from “Startup Script” section that belongs to the List Page in order to update the value in database, afterwards update only the related part in the row when the AJAX callback returns success.
Thank you Mobhar and Arbei!