I have custom admin grid, I want to add product edit link on it.
I have a column that is showing product id, I want to use edit link instead of id. code for that column is this:
$this->addColumn(
'product_id',
[
'header' => __('Edit Product'),
'index' => 'product_id',
]
);
asked Apr 24, 2019 at 9:50
1 Answer 1
Add this action column in your grid file. It will add the product edit option in grid.
$this->addColumn('action', array(
'header' => __('Action'),
'width' => '100',
'type' => 'action',
'getter' => 'getProductId',
'actions' => array(
array(
'caption' => __('View'),
'url' => array('base' => 'catalog/product/edit'),
'target'=>'_blank',
'field' => 'product_id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'id',
'is_system' => true,
));
I hope this will help
answered Apr 24, 2019 at 9:55
default