首页 > 解决方案 > 如何使用 react-data-table-component 在 Reactjs DataTable 中的页面加载时保持可扩展行的扩展

问题描述

<DataTable
width={this.width}
columns={this.getSectionColumns()}
data={this.state.listPolicy}
striped={true}
highlightOnHover={true}
pointerOnHover={false}//SJ -13/07/2020- To remove pointer (hand icon from row items)
noHeader={true}
className={'tableEmployee'}
expandableRows
noDataComponent={this.state.loading ? '' : 'There are no records to display.'}
       
progressComponent={<BallTriangleProgressComponent />}
progressPending={this.state.loading}
expandableRowsComponent={
<SubCategoryTable
isAdminMode={this.props.isAdminMode}
isManagerMode={this.props.isManagerMode}
sectionID={this.props.sectionID}
onSavePolicySubCategory={this.onSavePolicySubCategory}
onUpdatePolicySubCategory={this.onUpdatePolicySubCategory}
onUpdateAlert={this.onUpdatePolicyAlert}
/>
}

/>

在对 SubCategoryTable 进行编辑或添加内容后,页面会刷新或重新加载以将新数据绑定到表。所以所有的行都崩溃了。有没有办法防止展开的行倒塌?

标签: reactjsdatatablereact-data-table-component

解决方案


推荐阅读