[英]react material-table's search filter does not work on render
搜索在這里工作正常:
<MaterialTable
columns={[
{ title: 'Name', field: 'firstname', type: 'string' }
]}
/>
但是搜索過濾器不適用於以下代碼:
<MaterialTable
columns={[
{ title: 'Name',
render: rowData =>{
return(<Link to = {`/${rowData.firstname}`}>
{rowData.firstname}
</Link>)
},
type: 'html'
}
]}
/>
This is the correct way to search on render. We need to add field to it.
<MaterialTable
columns={[
{ title: 'Name',
field: 'location_name',
render: rowData =>{
return(<Link to = {`/${rowData.firstname}`}>
{rowData.firstname}
</Link>)
},
type: 'html'
}
]}
/>
就像user10665299告訴你的,需要添加field
..你可以刪除type
屬性,不是必需的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.