Choosing which Columns are Filterable- DataTable

I am creating a datable that has 3 columns. One of the columns is quantity. I would like to be able to filter the other 2 columns, but not quantity. Is there a way to “choose” which columns are filterable? filter_action=‘native’ makes it so all columns are filterable.

hi @kelly_gfc Kelly,
I don’t think that is possible. I found a way to hide filtering style_filter={'display':None, 'visibility': 'hidden'}, within the Datatable, but that’s on the table level, not column level.

Thanks, Adam! That might be a helpful feature to add…obviously not an immediate need. It would be nice if we could use an if statement like:

 columns = [
        {"name": i, "id": i, "deletable": False, "selectable": False, "hideable": False, 'filter_action': 'native'}
        if i == 'Quantity'
        else {"name": i, "id": i, "deletable": False, "selectable": False, "hideable": False}
        for i in filtered_data.columns
    ]
1 Like