Skip to content

Commit e1480e0

Browse files
author
Henrik jJaven
committed
DooHTML-keyed-v0.70.1
1 parent 0bb3c44 commit e1480e0

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

frameworks/keyed/doohtml/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<title>DooHTML</title>
66
<link href="/css/currentStyle.css" rel="preload" as="style"/>
77
<link href="/css/currentStyle.css" rel="stylesheet"/>
8-
<link href="./js/doo.html.js" rel="preload" as="script"/>
9-
<script type="module" src="./js/doo.html.js"></script>
8+
<link href="./js/doo.html.min.js" rel="preload" as="script"/>
9+
<script type="module" src="./js/doo.html.min.js"></script>
1010
<script type="module" src="./js/Main.class.js" defer ></script>
1111
</head>
1212
<body>

frameworks/keyed/doohtml/js/Main.class.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie"
88

99
const lenA = adjectives.length, lenB = colours.length, lenC = nouns.length
1010

11-
import Timer from './doo.timer.js'
12-
1311
Doo.define(
1412
class Main extends Doo {
1513
constructor() {
@@ -92,13 +90,25 @@ Doo.define(
9290
this.data.rows = this.data.rows.concat(this.buildData())
9391
this.renderTable(this.data.rows, this.data.rows.length)
9492
}
95-
// add() {
96-
// // let startRow = this.data.rows.length
97-
// this.data.rows = this.data.rows.concat(this.buildData())
98-
// this.renderTable(this.data.rows, this.data.rows.length)
93+
add() {
94+
let startRow = this.data.rows.length
95+
this.data.rows = this.data.rows.concat(this.buildData())
96+
this.renderTable(this.data.rows, startRow)
9997

100-
// }
98+
}
10199

100+
renderTable(dataSet=this.data[this.defaultDataSet], start=0) {
101+
// debugger
102+
let len = dataSet.length - start
103+
let elem = document.createElement('tbody')
104+
elem.innerHTML = this.renderNode(this.place[0], dataSet, start , len)
105+
let tableRows = elem.querySelectorAll('tr')
106+
let newElem
107+
for (let i=0;i<len;i++) {
108+
newElem = this.place[0].appendChild(tableRows.item(i))
109+
newElem.key = dataSet[i].id
110+
}
111+
}
102112

103113

104114
runLots() {

frameworks/keyed/doohtml/js/doo.html.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/non-keyed/doohtml/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link href="/css/currentStyle.css" rel="preload" as="style"/>
77
<link href="/css/currentStyle.css" rel="stylesheet"/>
88
<link href="./js/doo.html.min.js" rel="preload" as="script"/>
9-
<script src="./js/doo.html.min.js"></script>
9+
<script type="module" src="./js/doo.html.min.js"></script>
1010
<script type="module" src="./js/Main.class.js" defer ></script>
1111
</head>
1212
<body>

frameworks/non-keyed/doohtml/js/Main.class.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ Doo.define(
7474
this.renderTable()
7575
}
7676
add() {
77+
let startRow = this.data.rows.length
7778
this.data.rows = this.data.rows.concat(this.buildData())
78-
this.renderTable(this.data.rows, this.data.rows.length)
79+
this.renderTable(this.data.rows, startRow)
7980
}
8081

8182
runLots() {

0 commit comments

Comments
 (0)