* Create table column elements. * * @param {number} column Visual column index. * @returns {DocumentFragment} Returns created column table column elements.
(column: number)
| 380 | * @returns {DocumentFragment} Returns created column table column elements. |
| 381 | */ |
| 382 | createCol(column: number) { |
| 383 | const rootDocument = this.hot!.rootDocument; |
| 384 | const fragment = rootDocument.createDocumentFragment(); |
| 385 | |
| 386 | this.samples!.forEach((sample: SampleEntry) => { |
| 387 | arrayEach(sample.strings, (string: SampleString) => { |
| 388 | const row = string.row!; |
| 389 | const cellProperties = this.hot!.getCellMeta<CellProperties>(row, column); |
| 390 | const renderer = this.hot!.getCellRenderer(cellProperties); |
| 391 | const td = rootDocument.createElement('td'); |
| 392 | const tr = rootDocument.createElement('tr'); |
| 393 | |
| 394 | // Indicate that this element is created and supported by GhostTable. It can be useful to |
| 395 | // exclude rendering performance costly logic or exclude logic which doesn't work within a hidden table. |
| 396 | td.setAttribute('ghost-table', '1'); |
| 397 | renderer(this.hot!, td, row, column, this.hot!.colToProp(column), string.value, cellProperties); |
| 398 | tr.appendChild(td); |
| 399 | fragment.appendChild(tr); |
| 400 | }); |
| 401 | }); |
| 402 | |
| 403 | return fragment; |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Remove table from document and reset internal state. |
no test coverage detected