Magento 2 Admin Grid Add/Update Button
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
In Magento 2.2.5, I am creating admin grid by following this tutorial(Using layout Block method. Not UI Component).
In that I have a add button. I can't remove it. I need to remove it and add a new button with custom url. How to achieve this.
Screenshot:
admin grid magento-2.2.5 custom-button
add a comment |Â
up vote
2
down vote
favorite
In Magento 2.2.5, I am creating admin grid by following this tutorial(Using layout Block method. Not UI Component).
In that I have a add button. I can't remove it. I need to remove it and add a new button with custom url. How to achieve this.
Screenshot:
admin grid magento-2.2.5 custom-button
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
In Magento 2.2.5, I am creating admin grid by following this tutorial(Using layout Block method. Not UI Component).
In that I have a add button. I can't remove it. I need to remove it and add a new button with custom url. How to achieve this.
Screenshot:
admin grid magento-2.2.5 custom-button
In Magento 2.2.5, I am creating admin grid by following this tutorial(Using layout Block method. Not UI Component).
In that I have a add button. I can't remove it. I need to remove it and add a new button with custom url. How to achieve this.
Screenshot:
admin grid magento-2.2.5 custom-button
admin grid magento-2.2.5 custom-button
asked 2 hours ago


Saravanan DS
441520
441520
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
You can use update
parent::_construct();
$this->buttonList->update('save', 'onclick', 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')');
add a comment |Â
up vote
0
down vote
Try using this code
parent::_construct();
$this->removeButton('add');
$this->buttonList->add(
'<your name>',
[
'label' => __('<your label>'),
'class' => 'save',
'onclick' => 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')',
'style' => ' background-color: #ba4000; border-color: #b84002; box-shadow: 0 0 0 1px #007bdb;color: #fff;text-decoration: none;'
]
);
Hope that will help you.
Yes, It is working. I have tried this but beforeparent::_construct();
i added this remove button code. So It is not worked.
– Saravanan DS
1 hour ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
You can use update
parent::_construct();
$this->buttonList->update('save', 'onclick', 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')');
add a comment |Â
up vote
5
down vote
You can use update
parent::_construct();
$this->buttonList->update('save', 'onclick', 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')');
add a comment |Â
up vote
5
down vote
up vote
5
down vote
You can use update
parent::_construct();
$this->buttonList->update('save', 'onclick', 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')');
You can use update
parent::_construct();
$this->buttonList->update('save', 'onclick', 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')');
answered 1 hour ago


Addify
6395
6395
add a comment |Â
add a comment |Â
up vote
0
down vote
Try using this code
parent::_construct();
$this->removeButton('add');
$this->buttonList->add(
'<your name>',
[
'label' => __('<your label>'),
'class' => 'save',
'onclick' => 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')',
'style' => ' background-color: #ba4000; border-color: #b84002; box-shadow: 0 0 0 1px #007bdb;color: #fff;text-decoration: none;'
]
);
Hope that will help you.
Yes, It is working. I have tried this but beforeparent::_construct();
i added this remove button code. So It is not worked.
– Saravanan DS
1 hour ago
add a comment |Â
up vote
0
down vote
Try using this code
parent::_construct();
$this->removeButton('add');
$this->buttonList->add(
'<your name>',
[
'label' => __('<your label>'),
'class' => 'save',
'onclick' => 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')',
'style' => ' background-color: #ba4000; border-color: #b84002; box-shadow: 0 0 0 1px #007bdb;color: #fff;text-decoration: none;'
]
);
Hope that will help you.
Yes, It is working. I have tried this but beforeparent::_construct();
i added this remove button code. So It is not worked.
– Saravanan DS
1 hour ago
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Try using this code
parent::_construct();
$this->removeButton('add');
$this->buttonList->add(
'<your name>',
[
'label' => __('<your label>'),
'class' => 'save',
'onclick' => 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')',
'style' => ' background-color: #ba4000; border-color: #b84002; box-shadow: 0 0 0 1px #007bdb;color: #fff;text-decoration: none;'
]
);
Hope that will help you.
Try using this code
parent::_construct();
$this->removeButton('add');
$this->buttonList->add(
'<your name>',
[
'label' => __('<your label>'),
'class' => 'save',
'onclick' => 'setLocation('' . $this->getUrl('*/*/<youraction>') . '')',
'style' => ' background-color: #ba4000; border-color: #b84002; box-shadow: 0 0 0 1px #007bdb;color: #fff;text-decoration: none;'
]
);
Hope that will help you.
answered 2 hours ago


Ashish Ranade
1626
1626
Yes, It is working. I have tried this but beforeparent::_construct();
i added this remove button code. So It is not worked.
– Saravanan DS
1 hour ago
add a comment |Â
Yes, It is working. I have tried this but beforeparent::_construct();
i added this remove button code. So It is not worked.
– Saravanan DS
1 hour ago
Yes, It is working. I have tried this but before
parent::_construct();
i added this remove button code. So It is not worked.– Saravanan DS
1 hour ago
Yes, It is working. I have tried this but before
parent::_construct();
i added this remove button code. So It is not worked.– Saravanan DS
1 hour ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246600%2fmagento-2-admin-grid-add-update-button%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password