MCPcopy Create free account
hub / github.com/handsontable/handsontable / addRow

Method addRow

handsontable/src/utils/ghostTable.ts:115–134  ·  view source on GitHub ↗

* Add row. * * @param {number} row Visual row index. * @param {Map} samples Samples Map object.

(row: number, samples: Map<string | number, SampleEntry>)

Source from the content-addressed store, hash-verified

113 * @param {Map} samples Samples Map object.
114 */
115 addRow(row: number, samples: Map<string | number, SampleEntry>) {
116 if (this.columns.length) {
117 throwWithCause('Doesn\'t support multi-dimensional table');
118 }
119 if (!this.rows.length) {
120 this.container = this.createContainer(this.hot!.rootElement.className);
121 }
122 const rowObject: Record<string, unknown> = { row };
123
124 this.rows.push(rowObject);
125
126 this.samples = samples;
127 this.table = this.createTable(this.hot!.table.className);
128 this.table.colGroup.appendChild(this.createColGroupsCol(row));
129 this.table.tr.appendChild(this.createRow(row));
130
131 this.container!.container.appendChild(this.table.fragment);
132
133 rowObject.table = this.table.table;
134 }
135
136 /**
137 * Add a row consisting of the column headers.

Callers 2

hotTable.spec.tsFile · 0.45
ghostTable.spec.jsFile · 0.45

Calls 6

createContainerMethod · 0.95
createTableMethod · 0.95
createColGroupsColMethod · 0.95
createRowMethod · 0.95
throwWithCauseFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected