komarovalexander / ka-table

Lightweight MIT React Table component with Sorting, Filtering, Grouping, Virtualization, Editing and many more
http://ka-table.com
MIT License
769 stars 56 forks source link

[Question] Is it possible to use different filteringModes on different columns? #358

Closed lamalvin21 closed 9 months ago

lamalvin21 commented 9 months ago

Hi,

I would like to have a table whereby some columns use the filteringMode of FilteringMode.FilterRow and some columns using FilteringMode.HeaderFilter. Here is what I have at the moment, I only have FilterRow at the moment but I would like Email, Role and Team to have the FilterRow, but Repo1, Repo2 and Repo3 to have FilterHeader. Is there anyway I could achieve that?

<Table
    columns={[
        { key: 'Email', title: 'Email', dataType: DataType.String },
        { key: 'Role', title: 'Role', dataType: DataType.String },
        { key: 'Team', title: 'Team', dataType: DataType.String },
        { key: 'Repo1', title: 'Repo 1', dataType: DataType.String },
        { key: 'Repo2', title: 'Repo 2', dataType: DataType.String },
        { key: 'Repo3', title: 'Repo 3', dataType: DataType.String },
    ]}
    data={data}
    paging={{
        enabled: true,
        pageSize: 8,
        position: PagingPosition.Bottom
    }}
    filteringMode={FilteringMode.FilterRow}
    rowKeyField={'id'}
    sortingMode={SortingMode.Single}
/>

Thanks for your help in advanced!

komarovalexander commented 9 months ago

Hi @lamalvin21 I've just added this ability to the ka-table, use FilteringMode.FilterRowAndHeaderFilter in v8.5.0

demo: https://stackblitz.com/edit/table-filter-row-ts-tyxaaf?file=Demo.tsx

komarovalexander commented 9 months ago

to hide filterRow and headerFilter for particular column customize headFilterButton and filterRowCell of childComponents https://komarovalexander.github.io/ka-table/#/filter-row-custom-editor

lamalvin21 commented 9 months ago

Thank you!