Есть ли способ использовать setDataAtCell или что-нибудь, что даст тот же результат с React? В настоящее время я пытаюсь обновить значение ячейки на основе значений нескольких других ячеек, но не могу понять, как это сделать, так как он продолжает перерисовывать и переполняет стек.
Вот часть, содержащая код где я пытаюсь установить значение столбца флажка в true, если какое-либо значение в той же строке было изменено.
class OrgHsTable extends React.Component {
constructor(props) {
super(props);
this.myRef = React.createRef();
this.state = {
error: null,
isLoaded: true,
items: this.props.items,
popupOpen: false,
checker: false
};
}
render() {
const hasError = this.state.error === null ? "" : <Popup open={this.state.popupOpen}
onClose={this.popUpClosed}>
<div style={{fontWeight:"bold", textAlign:"center"}}>
<h3>Error</h3>
<hr />
<div style={{margin:"10px", fontWeight:"bold"}}>
{this.state.error}
</div>
</div>
</Popup>;
const isLoading = this.state.isLoaded ? <HotTable
root="hot"
data={this.state.items}
rowHeaders={true}
columns={this.props.columns}
contextMenu={true}
ref={this.myRef}
columnSorting={true}
dropdownMenu={true}
filters={true}
manualColumnResize={true}
manualRowResize={true}
afterFilter={this.updateOnFilter}
afterChange={(function(changes,source) {
if (changes) {
this.myRef.current.hotInstance.setDataAtCell(changes[0][0], 14, true)
}
}).bind(this)
}
/> : <h3><em>Loading data...</em></h3>;