|
onCellSecondaryTap: (details) {
int
rowIndex = details.rowColumnIndex.rowIndex - 1;
int
colIndex = details.rowColumnIndex.columnIndex;
if
(rowIndex >= 0 && colIndex >= 0) {
//
Check if the right-clicked row is already selected, Remove selection.
if
(_dataGridController.selectedRows
.contains(employeeDataSource._employeeData[rowIndex])) {
selectedRows.remove(employeeDataSource._employeeData[rowIndex]);
_dataGridController.selectedRows
= List.from(selectedRows);
// Moves the current cell to the tapped cell when the navigation mode
is set to 'cell'.
_dataGridController
.moveCurrentCellTo(RowColumnIndex(rowIndex, colIndex));
}
else {
// If not selected, select the row.
_dataGridController.selectedRows = [];
selectedRows.add(employeeDataSource._employeeData[rowIndex]);
_dataGridController.selectedRows
= List.from(selectedRows);
// Moves the current cell to the tapped cell when the navigation mode
is set to 'cell'.
_dataGridController
.moveCurrentCellTo(RowColumnIndex(rowIndex, colIndex));
}
}
},
|