Good morning,
So basically I wanted to conditionally disableSortBy option in a react-table column based on a props parameter, I was never able to make it work and honestly I have no idea how to fix this. While the parameter changes on click(and it's working as intended) the view doesn't change at all.
I've tried numerous ways to make it work, didn't succeed unfortunately, the conditional part of the code in react-table column is:
> disableSortBy:
> this.props.completedData === true && this.props.toDoData === true
> ? false
> : this.props.completedData === true && this.props.toDoData === false
> ? false
> : true,
What I want to achieve is that if only the toDoData is true, the sortby option should be disabled, otherwise there should be a possibility to sort table rows.
As I was asked for some more code, I will include the method that changes the value upon click.
private toDoHandler() {
if (this.state.toDoChecked && !this.state.completedChecked) {
return;
} else {
this.setState({ toDoChecked: !this.state.toDoChecked });
}
}
The value is then transfered to another component and used as a props here.