1

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
6
  • Both questions are creaed by me. No duplication, here the question is in xml file! Commented Dec 21, 2016 at 10:20
  • "POSSIBLE duplication", pls read carefully then make marking decision as it affects getting the problem solved Commented 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 duplication Commented Dec 21, 2016 at 10:33
  • They are related to different scenarios, why should I combine them? Commented Dec 21, 2016 at 10:34
  • Let's decide community then :) Commented Dec 21, 2016 at 10:36

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.