MCPcopy Create free account
hub / github.com/chieapp/chie / setData

Method setData

src/view/editable-table.ts:48–59  ·  view source on GitHub ↗
(data: T[])

Source from the content-addressed store, hash-verified

46 }
47
48 setData(data: T[]) {
49 this.data = data;
50 // Recreate the model to fill data.
51 const model = gui.SimpleTableModel.create(this.columns.length);
52 const rows = data.map(d => this.columns.map(column => d[column.key]));
53 for (const row of rows)
54 model.addRow(row);
55 this.table.setModel(model);
56 // After changing model, all items are unselected.
57 this.editButton.setEnabled(false);
58 this.removeButton.setEnabled(false);
59 }
60
61 #editSelectedRow() {
62 const index = this.table.getSelectedRow();

Callers 1

updateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected