TableNG: Always use correct original row index (#104561)
* fix: change row index * chore: remove unused param
This commit is contained in:
@@ -451,8 +451,6 @@ export function TableNG(props: TableNGProps) {
|
||||
ctx,
|
||||
onSortByChange,
|
||||
rows,
|
||||
// INFO: sortedRows is for correct row indexing for cell background coloring
|
||||
sortedRows,
|
||||
setContextMenuProps,
|
||||
setFilter,
|
||||
setIsInspecting,
|
||||
@@ -662,7 +660,6 @@ export function mapFrameToDataGrid({
|
||||
ctx,
|
||||
onSortByChange,
|
||||
rows,
|
||||
sortedRows,
|
||||
setContextMenuProps,
|
||||
setFilter,
|
||||
setIsInspecting,
|
||||
@@ -787,7 +784,7 @@ export function mapFrameToDataGrid({
|
||||
field,
|
||||
cellClass: textWraps[getDisplayName(field)] ? styles.cellWrapped : styles.cell,
|
||||
renderCell: (props: RenderCellProps<TableRow, TableSummaryRow>): JSX.Element => {
|
||||
const { row, rowIdx } = props;
|
||||
const { row } = props;
|
||||
const cellType = field.config?.custom?.cellOptions?.type ?? TableCellDisplayMode.Auto;
|
||||
const value = row[key];
|
||||
// Cell level rendering here
|
||||
@@ -801,7 +798,7 @@ export function mapFrameToDataGrid({
|
||||
timeRange={timeRange ?? getDefaultTimeRange()}
|
||||
height={defaultRowHeight}
|
||||
justifyContent={justifyColumnContent}
|
||||
rowIdx={sortedRows[rowIdx].__index}
|
||||
rowIdx={row.__index}
|
||||
shouldTextOverflow={() =>
|
||||
shouldTextOverflow(
|
||||
key,
|
||||
|
||||
@@ -502,7 +502,6 @@ export interface MapFrameToGridOptions extends TableNGProps {
|
||||
ctx: CanvasRenderingContext2D;
|
||||
onSortByChange?: (sortBy: TableSortByFieldState[]) => void;
|
||||
rows: TableRow[];
|
||||
sortedRows: TableRow[];
|
||||
setContextMenuProps: (props: { value: string; top?: number; left?: number; mode?: TableCellInspectorMode }) => void;
|
||||
setFilter: React.Dispatch<React.SetStateAction<FilterType>>;
|
||||
setIsInspecting: (isInspecting: boolean) => void;
|
||||
|
||||
Reference in New Issue
Block a user