FIX: Reset table properties after building table

Ensures data is cleared after building a table so that additional tables can be build without remaining old data.
This commit is contained in:
Keegan George 2022-07-04 16:31:11 -07:00
parent 9354a5576b
commit 867ea71ceb
1 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,13 @@ export default class extends Controller {
{ column: 2, rows: A([{ id: 1 }]) }, { column: 2, rows: A([{ id: 1 }]) },
]); ]);
resetData() {
this.tableItems = A([
{ column: 1, rows: A([{ id: 1 }]) },
{ column: 2, rows: A([{ id: 1 }]) },
]);
}
@action @action
cancelTableCreation() { cancelTableCreation() {
this.send("closeModal"); this.send("closeModal");
@ -80,6 +87,7 @@ export default class extends Controller {
@action @action
createTable() { createTable() {
this.buildTable(this.tableItems); this.buildTable(this.tableItems);
this.resetData();
this.send("closeModal"); this.send("closeModal");
} }