bug: validate is not called when updating data
ReactTabulator never calls "table.validate()" when data are loaded or changed. We have to do it manually, using the ref : this.state.tableRef.table.validate() Could add the validate when loading or changing the data ?
I'm not aware of validate(). Is this a common use case? It'd be helpful to understand if you have a Codesandbox link and example. Thanks.
Here is the documentation : http://tabulator.info/docs/4.9/validate#manual
We use custom validators. Every time we update the data, we have to force table.redraw() and table.validate() to get the data validation. Would be nice if it could be done autmatically when the props.data changes
dataLoaded = () => {
this.state.tableRef.table.redraw()
this.validateTable()
}
validateTable = () => {
if(this.state.tableRef && this.state.tableRef.table){
this.state.tableRef.table.validate()
}
}
render() {
return (
<div className={Style.StoreTable}>
<ReactTabulator
ref={this.setTable}
options={this.options}
columns = {this.state.columns}
data= {this.state.data}
rowFormatter={this.rowValidator}
rowSelected={this.rowSelected}
rowClick={this.rowClick}
dataChanged={this.dataLoaded}
dataLoaded={this.dataLoaded}
initialSort={[{column: 'valid', dir: 'asc'}]}/>
</div>
)
}