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

Method appendRowHeader

handsontable/src/tableView.ts:1486–1514  ·  view source on GitHub ↗

* Append row header to a TH element. * * @private * @param {number} visualRowIndex The visual row index. * @param {HTMLTableHeaderCellElement} TH The table header element.

(visualRowIndex: number, TH: HTMLTableCellElement)

Source from the content-addressed store, hash-verified

1484 * @param {HTMLTableHeaderCellElement} TH The table header element.
1485 */
1486 appendRowHeader(visualRowIndex: number, TH: HTMLTableCellElement) {
1487 if (TH.firstChild) {
1488 const container = TH.firstChild as HTMLElement;
1489
1490 if (!hasClass(container, 'relative')) {
1491 empty(TH);
1492 this.appendRowHeader(visualRowIndex, TH);
1493
1494 return;
1495 }
1496
1497 this.updateCellHeader(
1498 container.querySelector<HTMLElement>('.rowHeader')!, visualRowIndex, this.hot.getRowHeader);
1499
1500 } else {
1501 const { rootDocument, getRowHeader } = this.hot;
1502 const div = rootDocument.createElement('div');
1503 const span = rootDocument.createElement('span');
1504
1505 div.className = 'relative';
1506 span.className = 'rowHeader';
1507 this.updateCellHeader(span, visualRowIndex, getRowHeader);
1508
1509 div.appendChild(span);
1510 TH.appendChild(div);
1511 }
1512
1513 this.hot.runHooks('afterGetRowHeader', visualRowIndex, TH);
1514 }
1515
1516 /**
1517 * Append column header to a TH element.

Callers 15

initializeWalkontableMethod · 0.95
createRowMethod · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80
rowHeaderFunction · 0.80

Calls 4

updateCellHeaderMethod · 0.95
hasClassFunction · 0.90
emptyFunction · 0.90
runHooksMethod · 0.65

Tested by 15

rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64
rowHeaderFunction · 0.64