Considering below code, what changes in xml is necessary to make the link recognize the 'target' => '_blank'?
xml file:
<columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
<actionsColumn name="login_as_customer" class="vendor\Module\Ui\Component\Listing\Column\Actions">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string">Login</item>
<item name="indexField" xsi:type="string">entity_id</item>
</item>
</argument>
</actionsColumn>
</columns>
Actions.php
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
$hidden = !$this->_authorization->isAllowed('vendor_Module::login_button');
foreach ($dataSource['data']['items'] as &$item) {
$item[$this->getData('name')]['edit'] = [
'href' => $this->urlBuilder->getUrl(
'loginascustomer/login/login',
['customer_id' => $item['entity_id']]
),
'label' => __('Login As Customer'),
'hidden' => $hidden,
'target' => '_blank',
];
}
}
return $dataSource;
}
asked Dec 21, 2016 at 10:17
Zinat
2,0992 gold badges31 silver badges53 bronze badges
-
Both questions are creaed by me. No duplication, here the question is in xml file!Zinat– Zinat2016年12月21日 10:20:01 +00:00Commented Dec 21, 2016 at 10:20
-
"POSSIBLE duplication", pls read carefully then make marking decision as it affects getting the problem solvedZinat– Zinat2016年12月21日 10:28:07 +00:00Commented Dec 21, 2016 at 10:28
-
To update only XML I think It's not valid to ask a new question. you can update your previous question. that's why this question is under duplicationKeyur Shah– Keyur Shah2016年12月21日 10:33:53 +00:00Commented Dec 21, 2016 at 10:33
-
They are related to different scenarios, why should I combine them?Zinat– Zinat2016年12月21日 10:34:59 +00:00Commented Dec 21, 2016 at 10:34
-
Let's decide community then :)Keyur Shah– Keyur Shah2016年12月21日 10:36:23 +00:00Commented Dec 21, 2016 at 10:36
default