我们有一个Kendo React网格,当数据为空时,我们需要显示No record found the message。
<Grid
sortable
filterable
expandField="expanded"
detail={props => <DetailComponent
{...props}
onChange={this.handleDetailTemplateChange}
changed={[]}
/>}
onExpandChange={this.expandChange}
pageable={this.state.pageable}
// scrollable="true"
editField="inEdit"
data={this.state.providersPage}
sort={this.state.sort}
onSortChange={this.handleSortChange}
filter={this.state.filter}
onFilterChange={this.handleFilterChange}
onPageChange={this.handlePageChange}
total={this.state.total}
skip={this.state.skip}
pageSize={this.state.pageSize}
onItemChange={this.handleProviderChange}
resizable>
<GridColumn field="affiliationRelationshipStatusName" title="Network Relationship" filterCell={this.CategoryFilterCell}
cell={NetworkRelationshipCell} width="245px"/>
<GridColumn field="address" title="Places" filterable={false} cell={NetworkPlaceCell}
width="245px"/>
</Grid>
请参阅Kendo文档,但找不到任何解决方案。请给出建议
发布于 2019-08-05 20:35:51
这些包附带了GridNoRecords导出的组件,您可以将这些组件放置在网格中。它将在没有记录时呈现。在导入栅格本身时将其导入:
import { Grid, GridColumn, GridNoRecords } from '@progress/kendo-react-grid'
然后把它放在网格里面,里面有一些内容。
<Grid data={[]}>
<GridNoRecords>
There is no data available
</GridNoRecords>
<GridColumn field="id" />
<GridColumn field="name" />
</Grid>
上面的例子来自official documentation。我相信这就是你要找的。
https://stackoverflow.com/questions/56892528
复制相似问题