Skip to content

Instantly share code, notes, and snippets.

@gabrielpetersson
Created May 26, 2022 13:16
Show Gist options
  • Save gabrielpetersson/22753a0263db824682cdd620689fc7d7 to your computer and use it in GitHub Desktop.
Save gabrielpetersson/22753a0263db824682cdd620689fc7d7 to your computer and use it in GitHub Desktop.
const getIsRangeAlreadyCorrect = () => {
const ranges = gridApi.getCellRanges();
if (ranges == null || ranges.length !== 1) {
return false;
}
const range = ranges[0]!;
if (range.columns.length !== 1) {
return false;
}
const column = range.columns[0]!;
if (range.startRow == null || range.startRow !== range.endRow) {
return false;
}
const isCorrectRange =
range.startRow.rowIndex === rowIndex &&
column.getColId() === params.colKey;
return isCorrectRange;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment