I have created a custom grid for reports in the admin without UI component. Now I want to add filters in the grid. Filters type Date-Range, Price-Range, Status.
<?php
protected function _prepareColumns() {
$this->addColumn(
'increment_id',
[
'header' => __('Increment ID#'),
'index' => 'increment_id',
]
);
$this->addColumn(
'order_id',
[
'header' => __('Order #'),
'index' => 'order_id',
]
);
$this->addColumn(
'created_at',
[
'header' => __('Purchased On'),
'index' => 'created_at',
]
);
$this->addColumn(
'amount_payable',
[
'header' => __('Actual Amount Paid'),
'index' => 'amount_payable',
]
);
$this->addColumn(
'amount_pay_later',
[
'header' => __('Balance Payment'),
'index' => 'amount_pay_later',
]
);
$this->addColumn(
'grand_total',
[
'header' => __('Grand Total'),
'index' => 'grand_total',
]
);
$this->addColumn(
'status',
[
'header' => __('Status'),
'index' => 'status',
]
);
$this->addColumn(
'method',
[
'header' => __('Payment Method'),
'index' => 'method',
]
);
$this->addColumn(
'billing_name',
[
'header' => __('Bill to Name'),
'index' => 'billing_name',
]
);
$this->addColumn(
'shipping_name',
[
'header' => __('Ship to Name'),
'index' => 'shipping_name',
]
);
$this->addExportType($this->getUrl('custom/*/exportCsv', ['_current' => true]), __('CSV'));
$this->addExportType($this->getUrl('custom/*/exportExcel', ['_current' => true]), __('Excel XML'));
$block = $this->getLayout()->getBlock('grid.bottom.links');
if ($block) {
$this->setChild('grid.bottom.links', $block);
}
return parent::_prepareColumns();
}
?>