initial
This commit is contained in:
parent
a60faa1cbd
commit
ea3b9d82c9
@ -11,6 +11,7 @@ class Table {
|
||||
}
|
||||
render(cell) {
|
||||
// clear children elements
|
||||
const allCells = [];
|
||||
var myNode = document.getElementById("table");
|
||||
while (myNode.firstChild) {
|
||||
myNode.removeChild(myNode.firstChild);
|
||||
@ -24,10 +25,12 @@ class Table {
|
||||
|
||||
for (var j = 0; j < this.columnLength; j++) {
|
||||
var letter = String.fromCharCode("A".charCodeAt(0) + j - 1);
|
||||
const instanceOfCell = new cell(letter + i);
|
||||
const instanceOfCell = new cell("cell" + letter + i);
|
||||
const newCell = row.insertCell(-1);
|
||||
|
||||
newCell.id = "cell" + letter + i;
|
||||
// allCells.push(instanceOfCell);
|
||||
newCell.addEventListener("click", () => {
|
||||
instanceOfCell.setColspan(5);
|
||||
console.log(instanceOfCell);
|
||||
this.showCellDetails(instanceOfCell);
|
||||
});
|
||||
@ -54,11 +57,7 @@ class Table {
|
||||
const cellButtonElement = document.createElement("button");
|
||||
cellButtonElement.innerHTML = "确定";
|
||||
// cellButtonElement.onclick = function() {
|
||||
// const test: HTMLTableElement = <HTMLTableElement>(
|
||||
// document.getElementById(instanceOfCell.cellId)
|
||||
// );
|
||||
// instanceOfCell[key] = test.value;
|
||||
// console.log(instanceOfCell);
|
||||
// const inputElement = document.getElementById(instanceOfCell.cellId);
|
||||
// };
|
||||
|
||||
cellLableElement.innerHTML = key;
|
||||
@ -95,8 +94,8 @@ class Cell {
|
||||
setBorder(newBorder: number) {
|
||||
this.border = newBorder;
|
||||
}
|
||||
setWidth(newWidth: number) {
|
||||
this.width = newWidth;
|
||||
setColspan(newColspan: number) {
|
||||
this.colspan = newColspan;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user