Skip to content

Commit

Permalink
Table: Return index on appendRow
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Oct 19, 2023
1 parent 533c6b9 commit 9df7408
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/scripting/SpreadSheetTableWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export class SpreadSheetTableWrapper {
constructor(
private spreadsheet: SpreadSheetTable,
private scriptEngine: ScriptEngine
) {}
) { }

addModifiedListener(listener: any) {}
addModifiedListener(listener: any) { }

addSelectionChangedListener(listener: any) {
this.spreadsheet.addSelectionChangedListener(() => {
Expand All @@ -20,7 +20,7 @@ export class SpreadSheetTableWrapper {
}

appendRow() {
this.spreadsheet.appendRow();
return this.spreadsheet.appendRow();
}

deleteColumn(index: number) {
Expand Down Expand Up @@ -98,4 +98,9 @@ export class SpreadSheetTableWrapper {
setRowForeground(row: number, color: Color) {
this.spreadsheet.setRowForeground(row, color);
}

revealRow(index: number) {
// Do nothing for now.
// Method added to not crash if it is used.
}
}
1 change: 1 addition & 0 deletions src/widgets/others/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class Table extends Widget {
init() {
this.tableWrapper = document.createElement("div");
this.tableWrapper.style.display = "none";
this.tableWrapper.style.overflow = "auto";
this.table = document.createElement("table");
this.table.style.tableLayout = "fixed";
this.table.style.borderSpacing = "0";
Expand Down

0 comments on commit 9df7408

Please sign in to comment.