Reactjs React JS物料表-如何在物料表中选择当前页面的行
当我单击select时,它会选择表的所有页面中的所有行 是否有方法仅选择物料表当前页面的行? 例如,如果我在第1页,它应该只选择第1页的行,而不会选择第2页的行Reactjs React JS物料表-如何在物料表中选择当前页面的行,reactjs,react-hooks,material-ui,material-table,Reactjs,React Hooks,Material Ui,Material Table,当我单击select时,它会选择表的所有页面中的所有行 是否有方法仅选择物料表当前页面的行? 例如,如果我在第1页,它应该只选择第1页的行,而不会选择第2页的行 <MaterialTable title="Actions On Selected Rows Preview" columns={[ { title: 'Name', field: 'name' }, { title: 'Surname', field: 'surname' },
<MaterialTable
title="Actions On Selected Rows Preview"
columns={[
{ title: 'Name', field: 'name' },
{ title: 'Surname', field: 'surname' },
{ title: 'Birth Year', field: 'birthYear', type: 'numeric' },
{
title: 'Birth Place',
field: 'birthCity',
lookup: { 34: 'İstanbul', 63: 'Şanlıurfa' },
},
]}
data={[
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63 },
{ name: 'Zerya Betül', surname: 'Baran', birthYear: 2017, birthCity: 34 },
{ name: 'Zerya Betül', surname: 'Baran', birthYear: 2017, birthCity: 34 },
{ name: 'Mehmet', surname: 'Baran', birthYear: 1987, birthCity: 63 },
{ name: 'Zerya Betül', surname: 'Baran', birthYear: 2017, birthCity: 34 },
{ name: 'Zerya Betül', surname: 'Baran', birthYear: 2017, birthCity: 34 },
]}
options={{
selection: true
}}
actions={[
{
tooltip: 'Remove All Selected Users',
icon: 'delete',
onClick: (evt, data) => alert('You want to delete ' + data.length + ' rows')
}
]}
/>
alert('要删除'+data.length+'行')
}
]}
/>