ListOptions_Rendered & Row_CustomAction

Anyone using 2026 had a problem with ListOptions_Rendered & Row_CustomAction
trying Example 2 but nothing happed when you click on add star.

function ListOptions_Rendered(): void
{
    $this->ListOptions["new"]->Body = "<a href=\"#\" onclick=\"return ew.submitAction(event, {action: 'star', method: 'ajax', msg: 'Add star?', key: " . $this->keyToJson(true) . "});\">Add Star</a>";
}

To run the inline onclick event, Use content security policy (CSP) need to be disabled.
is there a way with CSP enable to use this feature?

Then you may try Example 3 or Example 4 under Page_Load server event of List Page.