通过设置selectable: row
. 网格允许您在每个页面中选择一个项目。我只想在 Grid 中选择一行并将所选行限制为 1。
<Grid
{...{
dataSource: dataSource,
sortable: sortable,
selectable: selectable,
scrollable: false,
navigatable: true,
filterable: filterable,
allowCopy: allowCopy,
pageable: pageable,
perPage: perPage,
editable: editable,
change: e => e.sender.selectedKeyNames()),
persistSelection: true,
columns: [
{
template: "<span class='sl-select-check'></span>",
attributes: { class: 'sl-select-check-td' }
},
...columns
]
}}
/>