/** * Prepare columns for pages grid * * @return $this */ protected function _prepareColumns() { $this->addColumn('chooser_id', array('header' => __('ID'), 'index' => 'page_id', 'header_css_class' => 'col-id', 'column_css_class' => 'col-id')); $this->addColumn('chooser_title', array('header' => __('Title'), 'index' => 'title', 'header_css_class' => 'col-title', 'column_css_class' => 'col-title')); $this->addColumn('chooser_identifier', array('header' => __('URL Key'), 'index' => 'identifier', 'header_css_class' => 'col-url', 'column_css_class' => 'col-url')); $this->addColumn('chooser_root_template', array('header' => __('Layout'), 'index' => 'root_template', 'type' => 'options', 'options' => $this->_pageLayout->getOptions(), 'header_css_class' => 'col-layout', 'column_css_class' => 'col-layout')); $this->addColumn('chooser_is_active', array('header' => __('Status'), 'index' => 'is_active', 'type' => 'options', 'options' => $this->_cmsPage->getAvailableStatuses(), 'header_css_class' => 'col-status', 'column_css_class' => 'col-status')); return parent::_prepareColumns(); }
/** * Prepare columns * * @return \Magento\Backend\Block\Widget\Grid\Extended */ protected function _prepareColumns() { $baseUrl = $this->getUrl(); $this->addColumn('title', array('header' => __('Title'), 'index' => 'title')); $this->addColumn('identifier', array('header' => __('URL Key'), 'index' => 'identifier')); $this->addColumn('root_template', array('header' => __('Layout'), 'index' => 'root_template', 'type' => 'options', 'options' => $this->_pageLayout->getOptions())); /** * Check is single store mode */ if (!$this->_storeManager->isSingleStoreMode()) { $this->addColumn('store_id', array('header' => __('Store View'), 'index' => 'store_id', 'type' => 'store', 'store_all' => true, 'store_view' => true, 'sortable' => false, 'filter_condition_callback' => array($this, '_filterStoreCondition'))); } $this->addColumn('is_active', array('header' => __('Status'), 'index' => 'is_active', 'type' => 'options', 'options' => $this->_cmsPage->getAvailableStatuses())); $this->addColumn('creation_time', array('header' => __('Created'), 'index' => 'creation_time', 'type' => 'datetime', 'header_css_class' => 'col-date', 'column_css_class' => 'col-date')); $this->addColumn('update_time', array('header' => __('Modified'), 'index' => 'update_time', 'type' => 'datetime', 'header_css_class' => 'col-date', 'column_css_class' => 'col-date')); $this->addColumn('page_actions', array('header' => __('Action'), 'sortable' => false, 'filter' => false, 'renderer' => 'Magento\\Cms\\Block\\Adminhtml\\Page\\Grid\\Renderer\\Action', 'header_css_class' => 'col-action', 'column_css_class' => 'col-action')); return parent::_prepareColumns(); }