Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Grid.php
Go to the documentation of this file.
1 <?php
7 
14 class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid
15 {
21  protected function _prepareMassaction()
22  {
23  return $this;
24  }
25 
31  protected function _prepareColumns()
32  {
33  $this->addColumn(
34  'entity_id',
35  [
36  'header' => __('ID'),
37  'index' => 'entity_id',
38  'header_css_class' => 'col-id',
39  'column_css_class' => 'col-id'
40  ]
41  );
42 
43  $this->addColumn('name', ['header' => __('Name'), 'index' => 'name']);
44 
45  $this->addColumn('sku', ['header' => __('SKU'), 'width' => 80, 'index' => 'sku']);
46  $this->addColumn(
47  'status',
48  [
49  'header' => __('Status'),
50  'width' => 50,
51  'index' => 'status',
52  'type' => 'options',
53  'options' => $this->_status->getOptionArray()
54  ]
55  );
56  return $this;
57  }
58 
64  public function getGridUrl()
65  {
66  return $this->getUrl('adminhtml/*/productGrid', ['_current' => true]);
67  }
68 
75  public function getRowUrl($row)
76  {
77  return $this->getUrl('adminhtml/*/edit', ['product' => $row->getId()]) . 'category';
78  }
79 }
__()
Definition: __.php:13