AllenFang / AllenFang/react-bootstrap-table

Column Filter in react-bootstrap-table-next not working?

Ouverte
#2,120 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
2.2k
Forks
761
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I have following widgets which represents categories form the data in the table: enter image description here

The flow is when a user clicks on one of the widgets the table should show data of that category only.

So far I have implemented following:

```
const columns = [
{
....
dataField: "Category",
formatter: formatCategory,
text: "Category",
sort: true,
filter: textFilter({
getFilter: (filter) => {
// nameFilter was assigned once the component has been mounted.
categoryFilter = filter;
}
})
....
}
```

Handle Clicking Event on Button and Passing the category:

```
const handleWidgetClick = (category) => {
categoryFilter = category;

// When I am doing something like this I am getting Uncaught Error
// categoryFilter is not a Function
categoryFilter(category)
};
```

I have followed example from [here](https://stackoverflow.com/questions/63176791/how-to-use-column-filter-in-react-bootstrap-table-next)

I am not sure what/where I am doing something wrong. Please guide me through it, Thanks

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.