[release-12.0.1] TableNG: Always use correct original row index (#104962)
TableNG: Always use correct original row index (#104561)
* fix: change row index
* chore: remove unused param
(cherry picked from commit cab241fbb6)
This commit is contained in:
@@ -456,8 +456,6 @@ export function TableNG(props: TableNGProps) {
|
||||
ctx,
|
||||
onSortByChange,
|
||||
rows,
|
||||
// INFO: sortedRows is for correct row indexing for cell background coloring
|
||||
sortedRows,
|
||||
setContextMenuProps,
|
||||
setFilter,
|
||||
setIsInspecting,
|
||||
@@ -664,7 +662,6 @@ export function mapFrameToDataGrid({
|
||||
ctx,
|
||||
onSortByChange,
|
||||
rows,
|
||||
sortedRows,
|
||||
setContextMenuProps,
|
||||
setFilter,
|
||||
setIsInspecting,
|
||||
@@ -788,7 +785,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
|
||||
@@ -802,7 +799,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