@platform/ui.datagrid
Version:
Isolated tabular DataGrid.
21 lines (20 loc) • 656 B
JavaScript
export function afterSelectionHandler(grid) {
let from = { cell: undefined, ranges: [] };
const afterSelection = (row1, column1, row2, column2, preventScrolling, selectionLayerLevel) => {
const to = grid.selection;
grid.fire({
type: 'GRID/selection',
payload: { from, to, grid },
});
from = Object.assign({}, to);
};
const afterDeselect = () => {
const to = grid.selection;
grid.fire({
type: 'GRID/selection',
payload: { from, to, grid },
});
from = Object.assign({}, to);
};
return { afterSelection, afterDeselect };
}