How to add a link in a grid column if the records are not found The 2019 Stack Overflow Developer Survey Results Are Inrender() must be compatible with MagentoBackendBlockWidgetGridColumnRendererRendererInterface::render(MagentoFrameworkDataObject $row)magento2 add display default value for column on admin gridColumn not found Magento2Magento 2 Add new field to Magento_User admin formMagento2 add new field in bundle item (in option selection)Magento 2 Grid serialization : not getting selected product idMagento 2 : Add values to ui_component fieldsColumn not found: 1054 Unknown column 'at_status_default.value'Column not found: 1054 Unknown column 'billing_telephone'how to add Custom column with link in sales order grid magento
Why can Shazam fly?
Aging parents with no investments
Where to refill my bottle in India?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
Reference request: Oldest number theory books with (unsolved) exercises?
How to support a colleague who finds meetings extremely tiring?
Is this app Icon Browser Safe/Legit?
Did Section 31 appear in Star Trek: The Next Generation?
Feature engineering suggestion required
Are spiders unable to hurt humans, especially very small spiders?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
Deal with toxic manager when you can't quit
One word riddle: Vowel in the middle
Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?
Have you ever entered Singapore using a different passport or name?
The difference between dialogue marks
Origin of "cooter" meaning "vagina"
What is the meaning of the verb "bear" in this context?
Why do we hear so much about the Trump administration deciding to impose and then remove tariffs?
"as much details as you can remember"
Can we generate random numbers using irrational numbers like π and e?
Are there any other methods to apply to solving simultaneous equations?
How to save as into a customized destination on macOS?
Can a flute soloist sit?
How to add a link in a grid column if the records are not found
The 2019 Stack Overflow Developer Survey Results Are Inrender() must be compatible with MagentoBackendBlockWidgetGridColumnRendererRendererInterface::render(MagentoFrameworkDataObject $row)magento2 add display default value for column on admin gridColumn not found Magento2Magento 2 Add new field to Magento_User admin formMagento2 add new field in bundle item (in option selection)Magento 2 Grid serialization : not getting selected product idMagento 2 : Add values to ui_component fieldsColumn not found: 1054 Unknown column 'at_status_default.value'Column not found: 1054 Unknown column 'billing_telephone'how to add Custom column with link in sales order grid magento
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I created a custom module.In grid if data is available then in action column edit option is there. If there is no data, then no edit option is displayed. So, I cannot enter into edit page if no data is available.
I cant use add new entry button. My requirement is to get the link in a grid column. I tried using a renderer but no luck.
namespace VendorModuleBlockAdminhtmlDataGridRenderer;
class Link extends MagentoBackendBlockWidgetGridColumnRendererAbstractRenderer
public function render(MagentoFrameworkDataObject $row)
$category = $row->getDataAllowed();
if (empty($category))
$value = $row->getData($this->getColumn()->getIndex());
return '<a href="http://www.google.com">New'.$value.'</a>';
and in customgrid.php I mention renderer also.
$this->addColumn('action', array(
'header' => __('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'renderer' => 'VendorModuleBlockAdminhtmlDataGridRendererLink',
'actions' => array(
array(
'caption' => __('Edit'),
'url' => array('base' => 'vendor_module/Data/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
The output should come like this
magento2 magento-2.0 magento-2.0.7
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I created a custom module.In grid if data is available then in action column edit option is there. If there is no data, then no edit option is displayed. So, I cannot enter into edit page if no data is available.
I cant use add new entry button. My requirement is to get the link in a grid column. I tried using a renderer but no luck.
namespace VendorModuleBlockAdminhtmlDataGridRenderer;
class Link extends MagentoBackendBlockWidgetGridColumnRendererAbstractRenderer
public function render(MagentoFrameworkDataObject $row)
$category = $row->getDataAllowed();
if (empty($category))
$value = $row->getData($this->getColumn()->getIndex());
return '<a href="http://www.google.com">New'.$value.'</a>';
and in customgrid.php I mention renderer also.
$this->addColumn('action', array(
'header' => __('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'renderer' => 'VendorModuleBlockAdminhtmlDataGridRendererLink',
'actions' => array(
array(
'caption' => __('Edit'),
'url' => array('base' => 'vendor_module/Data/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
The output should come like this
magento2 magento-2.0 magento-2.0.7
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16
add a comment |
I created a custom module.In grid if data is available then in action column edit option is there. If there is no data, then no edit option is displayed. So, I cannot enter into edit page if no data is available.
I cant use add new entry button. My requirement is to get the link in a grid column. I tried using a renderer but no luck.
namespace VendorModuleBlockAdminhtmlDataGridRenderer;
class Link extends MagentoBackendBlockWidgetGridColumnRendererAbstractRenderer
public function render(MagentoFrameworkDataObject $row)
$category = $row->getDataAllowed();
if (empty($category))
$value = $row->getData($this->getColumn()->getIndex());
return '<a href="http://www.google.com">New'.$value.'</a>';
and in customgrid.php I mention renderer also.
$this->addColumn('action', array(
'header' => __('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'renderer' => 'VendorModuleBlockAdminhtmlDataGridRendererLink',
'actions' => array(
array(
'caption' => __('Edit'),
'url' => array('base' => 'vendor_module/Data/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
The output should come like this
magento2 magento-2.0 magento-2.0.7
I created a custom module.In grid if data is available then in action column edit option is there. If there is no data, then no edit option is displayed. So, I cannot enter into edit page if no data is available.
I cant use add new entry button. My requirement is to get the link in a grid column. I tried using a renderer but no luck.
namespace VendorModuleBlockAdminhtmlDataGridRenderer;
class Link extends MagentoBackendBlockWidgetGridColumnRendererAbstractRenderer
public function render(MagentoFrameworkDataObject $row)
$category = $row->getDataAllowed();
if (empty($category))
$value = $row->getData($this->getColumn()->getIndex());
return '<a href="http://www.google.com">New'.$value.'</a>';
and in customgrid.php I mention renderer also.
$this->addColumn('action', array(
'header' => __('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getId',
'renderer' => 'VendorModuleBlockAdminhtmlDataGridRendererLink',
'actions' => array(
array(
'caption' => __('Edit'),
'url' => array('base' => 'vendor_module/Data/edit'),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
'is_system' => true,
));
The output should come like this
magento2 magento-2.0 magento-2.0.7
magento2 magento-2.0 magento-2.0.7
edited Nov 22 '16 at 5:32
Rising
asked Nov 21 '16 at 12:55
RisingRising
313
313
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16
add a comment |
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16
add a comment |
1 Answer
1
active
oldest
votes
In your Grid
class add this method:
public function getEmptyText()
$url = $this->getUrl('module/controller/new')
return '<a href="'.$url.'">'.__('New record').'</a>';
replace module
and controller
with the real values from your module.
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f146754%2fhow-to-add-a-link-in-a-grid-column-if-the-records-are-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your Grid
class add this method:
public function getEmptyText()
$url = $this->getUrl('module/controller/new')
return '<a href="'.$url.'">'.__('New record').'</a>';
replace module
and controller
with the real values from your module.
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
add a comment |
In your Grid
class add this method:
public function getEmptyText()
$url = $this->getUrl('module/controller/new')
return '<a href="'.$url.'">'.__('New record').'</a>';
replace module
and controller
with the real values from your module.
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
add a comment |
In your Grid
class add this method:
public function getEmptyText()
$url = $this->getUrl('module/controller/new')
return '<a href="'.$url.'">'.__('New record').'</a>';
replace module
and controller
with the real values from your module.
In your Grid
class add this method:
public function getEmptyText()
$url = $this->getUrl('module/controller/new')
return '<a href="'.$url.'">'.__('New record').'</a>';
replace module
and controller
with the real values from your module.
answered Nov 21 '16 at 13:40
Marius♦Marius
168k28323689
168k28323689
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
add a comment |
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
Thanks Marius but still I am not getting proper output. I edited my question by adding the image. Please help me thanks in advance.
– Rising
Nov 22 '16 at 5:33
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f146754%2fhow-to-add-a-link-in-a-grid-column-if-the-records-are-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
using Ui components ? Or BlocK ?
– Tushar
Sep 6 '18 at 17:16