qlik-oss/sn-table

View on GitHub
src/table/virtualized-table/utils/get-cell-item-key.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Cell } from "../../../types";
import { ItemData } from "../types";

interface Props {
  rowIndex: number;
  columnIndex: number;
  data: ItemData;
}

const getCellItemKey = ({ columnIndex, data, rowIndex }: Props) => {
  const cell = data.rowsInPage[rowIndex]?.[`col-${columnIndex}`] as Cell;

  return `${cell?.qElemNumber}-${cell?.qText}-${rowIndex}-${columnIndex}`;
};

export default getCellItemKey;