2

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

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
0

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.