9 use Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Grid\CollectionFactory as GridCollectionFactory;
11 class Grid extends \Magento\Backend\Block\Widget\Grid\Extended
22 private $gridCollectionFactory;
34 \
Magento\Backend\Helper\Data $backendHelper,
37 GridCollectionFactory $gridColFactory =
null 40 $this->_collectionFactory = $collectionFactory;
41 $this->gridCollectionFactory = $gridColFactory
42 ? : ObjectManager::getInstance()->get(GridCollectionFactory::class);
44 parent::__construct($context, $backendHelper,
$data);
54 $this->setId(
'agreementGrid');
66 return parent::_prepareCollection();
78 'index' =>
'agreement_id',
79 'header_css_class' =>
'col-id',
80 'column_css_class' =>
'col-id' 87 'header' =>
__(
'Condition'),
89 'header_css_class' =>
'col-name',
90 'column_css_class' =>
'col-name' 94 if (!$this->_storeManager->isSingleStoreMode()) {
98 'header' =>
__(
'Store View'),
102 'store_view' =>
true,
104 'filter_condition_callback' => [$this,
'_filterStoreCondition'],
105 'header_css_class' =>
'col-store-view',
106 'column_css_class' =>
'col-store-view' 114 'header' =>
__(
'Status'),
115 'index' =>
'is_active',
117 'options' => [0 =>
__(
'Disabled'), 1 =>
__(
'Enabled')],
118 'header_css_class' =>
'col-status',
119 'column_css_class' =>
'col-status' 123 return parent::_prepareColumns();
132 parent::_afterLoadCollection();
143 if (!(
$value = $column->getFilter()->getValue())) {
157 return $this->
getUrl(
'checkout/*/edit', [
'id' =>
$row->getId()]);
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\CollectionFactory $collectionFactory, array $data=[], GridCollectionFactory $gridColFactory=null)
_filterStoreCondition($collection, $column)
getUrl($route='', $params=[])