Here i have to add filter in charity and fee column,if charity is filled then display in grid otherwise that data should not show in grid.

But here all record's are displayed. Thank you.. enter image description here

2 Answers 2


In your ui component add the following code

<filters name="listing_filters">
                            <param name="template" xsi:type="string">ui/grid/filters/elements/ui-select</param>
                            <param name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</param>

 <column name="id">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="sorting" xsi:type="string">desc</item>
                    <item name="label" xsi:type="string" translate="true">ID</item>
  • any issues let me know
    – mohith
    Apr 26, 2019 at 12:31
  • Thanks, But its add only new column.
    – moni patel
    Apr 29, 2019 at 5:24
  • add this line for each column <item name="filter" xsi:type="string">textRange</item>
    – mohith
    Apr 29, 2019 at 16:46

Edit Namespace\Module\Model\ResourceModel\Employee\Grid\Collection file and add below function in it.

protected function _renderFiltersBefore() {
    $this->getSelect()->where('main_table.status = 1');
  • But this is not working.
    – moni patel
    Apr 26, 2019 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.