I wish to add button field in layout grid(without using UI component), After adding button, also need to add click function to that field. Please provide me a solution to add button as a field in the grid.
1 Answer
I hope you are trying to add a separate button with some required action. In that case, you can load the row with renderer file, in that renderer, you can call the PHTML template, like below.
public function render(DataObject $row)
{
$block = <load-your-block-file>;
$block->setTemplate('path/to/template.phtml');
return $block->toHtml();
}
And I hope you can load your button with $row as dynamic data for required action