1

I have a Grid View using UI and i want when click edit a record in this grid, it redirect immediate to tab custom option in Product(#product_info_tabs_customer_options).

In Magento 1.x, i create link when pass params as 'params' => array('tab' => 'id_of_tab') in function getUrl.
In Magento 2, What do i should to pass params in function getUrl ?

Thanks in advance.

2

The url should contain /active_tab/order_creditmemos/

where 'order_creditmemos' is the name attribute of the tab

<a href="#sales_order_view_tabs_order_creditmemos_content" ... name="order_creditmemos" ...>

See /app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php

/**
 * Retrieve back url
 *
 * @return string
 */
public function getBackUrl()
{
    return $this->getUrl(
        'sales/order/view',
        [
            'order_id' => $this->getCreditmemo() ? $this->getCreditmemo()->getOrderId() : null,
            'active_tab' => 'order_creditmemos'
        ]
    );
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.