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>? Oct 9 '18 at 6:20
  • @RutveeSojitra It is not Ui component Grid Oct 9 '18 at 6:21
  • Okay so in layout what you want change? means which url url are you talking about? Oct 9 '18 at 6:22
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

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.