diff --git a/docs/row-selection.md b/docs/row-selection.md index 9a09361..c8b97e3 100644 --- a/docs/row-selection.md +++ b/docs/row-selection.md @@ -211,18 +211,44 @@ const selectRow = { }; ``` +> If you want to reject current select action, just return `false`: + +```js +const selectRow = { + mode: 'checkbox', + onSelect: (row, isSelect, rowIndex, e) => { + if (SOME_CONDITION) { + return false; + } + } +}; +``` + ### selectRow.onSelectAll - [Function] This callback function will be called when select/unselect all and it only work when you configure [`selectRow.mode`](#mode) as `checkbox`. ```js const selectRow = { mode: 'checkbox', - onSelectAll: (isSelect, results, e) => { + onSelectAll: (isSelect, rows, e) => { // ... } }; ``` +> If you want to control the final selection result, just return a row key array: + +```js +const selectRow = { + mode: 'checkbox', + onSelectAll: (isSelect, rows, e) => { + if (isSelect && SOME_CONDITION) { + return [1, 3, 4]; // finally, key 1, 3, 4 will being selected + } + } +}; +``` + ### selectRow.hideSelectColumn - [Bool] Default is `false`, if you don't want to have a selection column, give this prop as `true`