reactjs - 如何使用 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 进行编辑或添加内容后,页面会刷新或重新加载以将新数据绑定到表。所以所有的行都崩溃了。有没有办法防止展开的行倒塌?
解决方案
推荐阅读
- python - 如何从熊猫数据框创建列表
- c# - 在用户的默认文件资源管理器中的 Xamarin Forms 中打开 Android 和 iOS 上的文件夹/目录
- flutter - 如何从父小部件访问 videoController
- javascript - 如何使用 Jest 在我的班级(TypeScript)中测试我的私有字段?
- javascript - 将数组的值添加到输入
- javascript - javascript将专有名称转换为域
- string - Springboot + mongodb 将字符串转换为日期
- javascript - 在 CSS 中更改滑块中内容的位置
- python-3.x - 如何使用枚举通过python api在其他方法中预处理元素名称
- javascript - 有没有办法将这些 .hide() 方法压缩成更好的 DRY 格式?