Added button to inverse part selection in tables

Fix issue #346
This commit is contained in:
Jan Böhmer 2023-08-21 22:48:47 +02:00
parent eaee4af715
commit 80bae4167f
3 changed files with 21 additions and 1 deletions

View file

@ -239,4 +239,16 @@ export default class extends Controller {
return this.element.dataset.select ?? false;
}
invertSelection() {
//Do nothing if the datatable is not selectable
if(!this.isSelectable()) {
return;
}
//Invert the selected rows on the datatable
const selected_rows = this._dt.rows({selected: true});
this._dt.rows().select();
selected_rows.deselect();
}
}