Row_CustomAction reload page (Solved)

Hi,
I am making an update on the current record and want to load/refresh the
page again. I tried : header(“Location: TFilesList”);


    if ($action == "applyTag") { // Check action name
        $newRow = ["tags" => $row["tags"] . " " .  $_SESSION['lastTag']]; // Array of field(s) to be updated
        $result = $this->update($newRow, ["id" => $row["id"]]); // Update the current record only (the second argument is WHERE clause for UPDATE statement)
        if (!$result) { // Failure
            $this->setFailureMessage("Failed to update record, id = " . $row["id"]);
            return false; // Abort and rollback
        } else { // Last row   
            $session = Session();
            $session->set('scrollToFile', $row["id"]);
            $this->setSuccessMessage("All selected records updated.");
        }
        
        header("Location: TFilesList");
        return true;
    }

    return true;

I solved it in list_option_rendered:
success: function(){window.location.reload();}


$this->ListOptions["applyTag"]->Body = "<a href=\"TFilesList\" onclick=\"return ew.submitAction(event, { success: function(){window.location.reload();} , action: 'applyTag', method: 'ajax', msg: 'Add tag?', key: " . $this->keyToJson(true) . "});\">".$_SESSION['lastTag']."</a>";
1 Like