table icon indicating copy to clipboard operation
table copied to clipboard

Not able to disable filter for one column.

Open hbulgarini opened this issue 9 years ago • 24 comments

Hello !

I'm trying to disable the filter by adding the property "filterable:false" on one specific column , but i'm afraid that this is not working and the filter is shown anyway for that column. Here is my setup for the specific column:

        const columns = [
            {
                header: '',
                accessor:'contract_id',
                filterable:false,
                render: ({value}) => (<button className="btn " onClick={(e) => this.ShowContract(e, value)}>Ver</button>)
}

Any ideas why it is not working? Do i'm settting in the incorrect way or the option for disable filters is not working?

Thanks!

hbulgarini avatar Jun 10 '17 00:06 hbulgarini

disableFilters: true not working in v7.7

@hrithiknaha you have to add an accessor property

xeiaaa avatar Feb 05 '22 02:02 xeiaaa

columns = [{ accessor: 'actions', Header: 'Actions', width: 250, disableSortBy: true, disableFilters: true, },..] disableFilters: true is not working for React Table 7.7.0 disableSortBy: true is working as expected.

WSINTRA avatar May 31 '22 14:05 WSINTRA

On v8:

const columns = [
    {
      header: 'E-mail',
      accessorKey: 'email',
      enableColumnFilter: false,
    }
]

jmaciaa avatar Sep 28 '22 12:09 jmaciaa

In the columns object, include the disableGlobalFilter property with a boolean value like...

 {
    Header: "First Name",
    accessor: "first_name",
    disableGlobalFilter: true, // disable global filter for this specific column
  }

My react-table version is 7.7.0

See the section Column Options at the link below

https://react-table.tanstack.com/docs/api/useGlobalFilter#table-options

image

disableGlobalFilter: true works for me.

andreasbalevik avatar Oct 13 '22 11:10 andreasbalevik