I've successfully created an admin grid using ui components. I've successfully added an actions column with a link. The link works but I want it to open in a new window or tab.
excerpt from ui_component
<actionsColumn name="actions" class="Vendor\Module\Ui\Component\Listing\Columns\Actions">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="indexField" xsi:type="string">id</item>
<item name="sortOrder" xsi:type="number">1000</item>
</item>
</argument>
</actionsColumn>
excerpt from Vendor\Module\Ui\Component\Listing\Columns\Actions
/**
* Prepare Data Source
* The delete function will be added later
*
* @param array $dataSource
* @return array
*/
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as &$item) {
if (isset($item[AlertInterface::ID])) {
$item[$this->getData('name')] = [
'view' => [
'href' => $this->urlBuilder->getUrl(
$this->dataSourceSolver->getViewActionPath(),
[
'id' => $item[AlertInterface::ID]
]
),
'popup' => true,
'target' => '_blank',
'label' => __('Preview')
]
];
}
}
}
return $dataSource;
}
}
The link works but does not open in new tab or window. There is an example in Marketing >Email Templates > Preview section but that code uses widgets and I'm using ui_components.
Any help is appreciated.