score:1
Accepted answer
to achieve that, you can use onfilterchange
callback, like this :
const options = {
...
onfilterchange: (column, filterlist, type) => {
const selectedfilters = this.extractfilters(filterlist);
console.log(selectedfilters);
}
}
this function will be called everytime filter list changes.
then, you declare function extractfilters
which will extract all selected filters from passed filterlist
and it will return array object containting all selected filters :
extractfilters = (filterlist) => {
let selectedfilters = [];
filterlist.foreach((filter) => {
if (filter.length > 0) {
selectedfilters.push(...filter);
}
});
return selectedfilters;
};
you can store this array in state.
here is working example.
Source: stackoverflow.com
Related Query
- Can I store these selected filters in a variable?
- How can I store a selected value in react combobox
- How can I store the selected semantic UI dropdown option in state?
- How can I send filters parameters selected from Ant design Reacjs to nodejs backend?
- How can I store an object in MeteorJS/React in a variable to return later?
- How can i store api response in variable and pass it to react popup video player
- Is there a way to bind the selected date in a calendar date picker to a variable that can be accessed by another file?
- How can I do to store a value in a variable from an external API using React.js?
- How Can I create a select input tag using Buttons and store the selected one in state
- how can i get the more than one data row value based on selected checkbox and store in useState (react-table-boostrap2)
- React : How can I store my text file's content into a variable using async->fetch
- While debugging, can I have access to the Redux store from the browser console?
- Can I view/modify the Redux store using Chrome Dev Tools
- Can a PWA app be published to app store and play store
- How can I pass a variable from 'outside' to a react app?
- How to set max number of items that can be selected in react-select?
- Can a Redux store lead to a memory leak?
- How can I set default sorter and filters on antd table components?
- How can I get a variable from the path in react router?
- Correct way (if possible) to store JSX code into a Javascript variable
- How can I access mobx store in another mobx store?
- Store multiple html elements in variable with React
- Why can I not use a variable as parameter in the require() function of node.js (browserify)?
- Can someone give proper explanation for ref vs controlled input and use case for state variable in react?
- how to store jsx element to javascript variable
- How can I store a JWT in cookies using Axios?
- react, useEffect: Can you use global variable as a dependent variable?
- How can I get rid of a URL in a fetch (to use kind of a variable instead)?
- How can you access redux's store from a non-component helper function?
- How can I make a variable have the type unknown or 'Movie' assigned?
More Query from same tag
- Azure webapplication return 404 when try to access using the address bar or refresh page
- react-select is blocking scroll when menu is open
- How to prevent user from entering negative number in react?
- React useEffect with an object
- Render recharts chart in RTL
- How come I can't use environment variables like this?
- React/JS Uncaught ReferenceError: require is not defined
- Access to component methods in React
- How to show an alert with errors found after submitting Formik form in react native
- Trouble with React SPA Routing
- Context API HOC Unit testing
- What do dollar and colon represent in React?
- React: Dropdown showing duplicate options than given
- reactjs state not updating via redux
- How to fill the horizontal space between two divs using dotted/dashed line using CSS
- How does React Lazy fetch components?
- How routing with react-router-dom?
- How to partially mock a custom react hook with Jest?
- Hiding Banner at a certain page
- Property 'loginToken' does not exist on type '{ loginToken: string; } | { error: Error; } | { username: string; password: string; }'
- ReactCSSTransitionGroup not working
- React+Redux Custom Hook (only update at certain conditions)
- React useState in functional components not updating the property values immediately
- Setting Authorization to specific parts of a component
- How to hide antd Modal header
- Component design hierearchy in React
- setState inside a setState component renders the whole component
- How to change React line chart tooltip title font family in chart.js
- React set state to nested object value
- Keeping a maximum length array, how do I remove old x length of old data while pushing in new data?