I want to call the function and then get the data from a database and reload the information of the table
Here is the code i have:
Code: Select all
customFilterData(e) {
console.log(e)
var filtros = this.state.filter_data
if (filtros === undefined){
filtros = e
}else {
if(filtros[filtros.length-1] !== e)
filtros.push(e)
}
this.setState({filter_data : filtros} , ()=>{this.getDataTable()})
}
customSortData(e) {
console.log(e)
var sorts = this.state.filter_data
if (sorts === undefined){
sorts = e
}else {
if(sorts[sorts.length-1] !== e)
sorts.push(e)
}
this.setState({sort_data : sorts}, () => {this.getDataTable()})
}