如何在React-Bootstrap-Table中删除对单元格的关注?

时间:2017-09-06 23:17:34

标签: html reactjs typescript react-bootstrap-table

我遇到的问题是,如果用户点击编辑一个单元格,然后在另一个重新渲染BootstrapTable的视图上执行某些操作,则该单元格仍然会聚焦并保留旧值,直到用户点击某处在桌子上。

我尝试了以下内容:

onBootstrapTableRef(instance) {
    this.bootstrapTableRef = instance;
}

componentDidUpdate() {
    this.bootstrapTableRef.reset(); //feel like either of these lines should do the job
    this.bootstrapTableRef.cleanSelected();
}


public render() {
    const cellEdit = {
        mode: "click",
        blurToSave: true
    }

    return (
                <BootstrapTable data={this.props.settings} keyField="settingStage"
                    bordered={false} striped cellEdit={cellEdit} ref={this.onBootstrapTableRef}>
                    ...
                </BootstrapTable>
            </div>
        </div>
    );
}

0 个答案:

没有答案