0

In Magento 2.2.5, How to change the URL of save button in the admin grid.

Note: I am not creating grid through ui_component, I am creating grid using layout.

Reference: Ref 1 Ref 2

3
  • What you want to change <item name="save" xsi:type="string">Vendor\Module\Block\Adminhtml\Edit\SaveButton</item>? Commented Oct 9, 2018 at 6:20
  • @RutveeSojitra It is not Ui component Grid Commented Oct 9, 2018 at 6:21
  • Okay so in layout what you want change? means which url url are you talking about? Commented Oct 9, 2018 at 6:22

1 Answer 1

3

You can modify the save button URL by overriding the getSaveUrl() function.

Navigate to

app/code/Vendor/Module/Block/Adminhtml/Module/Edit.php

add the following function in this file

public function getSaveUrl()
{
    return $this->getUrl('module/controller/action');
}
1
  • Its working fine. Commented Oct 9, 2018 at 6:44

Your Answer

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

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