diff --git a/src/app/services/tabulatorDataService.spec.ts b/src/app/services/tabulatorDataService.spec.ts index 9773eb93e30..88a14c863e5 100644 --- a/src/app/services/tabulatorDataService.spec.ts +++ b/src/app/services/tabulatorDataService.spec.ts @@ -32,7 +32,7 @@ function convertTableDataToTabulator() { expect(tabulatorData.data.length).toBe(3); expect(tabulatorData.data[1]['0']).toBe('10'); expect(tabulatorData.options.maxHeight).toBe('500px'); - expect(tabulatorData.editableCells[0]).toEqual(['1','2']); + expect(tabulatorData.editableCells[1]).toEqual(['1', '2']); }); }); } diff --git a/src/assets/wise5/components/table/table-student/table-student.component.ts b/src/assets/wise5/components/table/table-student/table-student.component.ts index 3a26dbc8457..a76cd45241a 100644 --- a/src/assets/wise5/components/table/table-student/table-student.component.ts +++ b/src/assets/wise5/components/table/table-student/table-student.component.ts @@ -1169,7 +1169,7 @@ export class TableStudent extends ComponentStudent { tabulatorCellChanged(cell: Tabulator.CellComponent): void { const columnIndex = parseInt(cell.getColumn().getField()); - const rowIndex = cell.getRow().getPosition() + 1; + const rowIndex = cell.getRow().getIndex() + 1; this.tableData[rowIndex][columnIndex].text = cell.getValue(); this.studentDataChanged(); } diff --git a/src/assets/wise5/components/table/tabulator-table/tabulator-table.component.ts b/src/assets/wise5/components/table/tabulator-table/tabulator-table.component.ts index 6a914f7245e..e90e3d4b73e 100644 --- a/src/assets/wise5/components/table/tabulator-table/tabulator-table.component.ts +++ b/src/assets/wise5/components/table/tabulator-table/tabulator-table.component.ts @@ -96,7 +96,7 @@ export class TabulatorTableComponent implements OnChanges, AfterViewInit { } private isCellEditable(cell: Tabulator.CellComponent): boolean { - const rowIndex = cell.getRow().getPosition(); + const rowIndex = cell.getRow().getIndex() + 1; const field = cell.getColumn().getField(); const row = this.editableCells[rowIndex]; return row && row.includes(field); diff --git a/src/assets/wise5/components/table/tabulatorDataService.ts b/src/assets/wise5/components/table/tabulatorDataService.ts index dddd624bf91..1fc349e71cd 100644 --- a/src/assets/wise5/components/table/tabulatorDataService.ts +++ b/src/assets/wise5/components/table/tabulatorDataService.ts @@ -16,7 +16,7 @@ export class TabulatorDataService { const rowData = this.getTabulatorRowDataFromTableRow(row, content.columns); rowData.values.id = rowIndex; content.data.push(rowData.values); - content.editableCells[rowIndex] = rowData.editableCells; + content.editableCells[index] = rowData.editableCells; } } return content;