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

asked Oct 9, 2018 at 6:07
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');
}
answered Oct 9, 2018 at 6:28
1
  • Its working fine. Commented Oct 9, 2018 at 6:44

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.