PablocFonseca / streamlit-aggrid

Implementation of Ag-Grid component for Streamlit
https://pypi.org/project/streamlit-aggrid/
MIT License
992 stars 190 forks source link

Is there a text column filter? #276

Open rafael-declarecripto opened 1 month ago

rafael-declarecripto commented 1 month ago

Hi. Is it possible to filter a text column? It is very common tables displaying text and eventually data such as type, category, status (enums).

{ "headerName":"country", "field":"country", "type":[ "textColumn", "textColumnFilter" ] }

I found only how to filter numeric colums. Ex.:

{ "headerName":"age", "field":"age", "type":[ "numericColumn", "numberColumnFilter" ] }

roddym commented 4 weeks ago

This sort of construct worked for me (to enable text filtering on my column called Suffix)

        gb = GridOptionsBuilder.from_dataframe(samplesdf)
        gb.configure_default_column()
        gb.configure_column("Suffix", filter="agTextColumnFilter")
        agdata = AgGrid(samplesdf, gridOptions=gb.build())