问题
How to filter the data while checking multiple checkbox in grid table? when I am selecting checkbox in the filter it should filter the data based on checkbox value. But am not able to filter the data when am checking multiple checkbox. Initially I tried for single checkbox filter it works fine.
ScaleChoiceFilter(value) {
console.log(value);
let newValue = this.state.text;
newValue.push(value);
this.setState(
{
text: newValue
},
() => {
this.props.filterChangedCallback();
}
);
}
doesFilterPass(params) {
return this.state.text
.toLowerCase()
.split(" ")
.every(filterWord => {
return (
this.valueGetter(params.node)
.toString()
.toLowerCase()
.indexOf(filterWord) >= 0
);
});}
in return am defining like this
<div>
{this.state.scaleFilterValue.map((scaleValue, index) => (
<ul>
<input
type="checkbox"
onChange={e => this.ScaleChoiceFilter(scaleValue)}
style={{
marginTop: 3
// verticalAlign: "top"
}}
/>{" "}
{scaleValue}
</ul>
))}
</div>
Expected Result: On clicking checkbox it should filter the data.
Actual Result: Filter is not working
for multiple checkbox in grid table
来源:https://stackoverflow.com/questions/57292008/how-to-filter-the-data-using-checkbox-in-aggrid-table-using-reactjs