@@ -113,7 +113,7 @@ Doo.define(
113
113
this . data . rows = this . buildData ( )
114
114
stop ( 'buildData' )
115
115
start ( 'run' )
116
- this . tbody . textContent = ""
116
+ this . tbody . textContent = ''
117
117
this . renderTable ( )
118
118
e . target . blur ( )
119
119
@@ -160,14 +160,11 @@ Doo.define(
160
160
// }
161
161
162
162
163
- // async attributeChangedCallback(name, oldVal, newVal) {
164
- // if (name === 'key' && newVal.length > 0) {
165
- // this.tbody.childNodes[newVal].childNodes[1].childNodes[0].innerHTML = this.data.rows[newVal].label
166
- // // if (newVal == 9999) {
167
- // // stop('runLots')
168
- // // }
169
- // }
170
- // }
163
+ async attributeChangedCallback ( name , oldVal , newVal ) {
164
+ if ( name === 'key' ) {
165
+ this . tbody . replaceChild ( this . tr [ newVal ] , this . tbody . childNodes [ newVal ] )
166
+ }
167
+ }
171
168
172
169
173
170
@@ -180,13 +177,43 @@ Doo.define(
180
177
elem . id = 'tbody'
181
178
let len = dataSet . length
182
179
elem . innerHTML = this . renderNode ( this . place [ 0 ] , this . data . rows , 0 , len )
183
- let tr = elem . querySelectorAll ( 'tr' )
180
+ this . tr = elem . querySelectorAll ( 'tr' )
184
181
185
- for ( let i = 0 ; i < len ; i ++ ) {
182
+ // for (let i=0;i<len;i++) {
183
+ // //let newRow = tableRef.insertRow(-1)
184
+ // //newRow.innerHTML = appendChild()
185
+ // this.setAttribute('key', i)
186
+
187
+ // // this.tbody.append(tr[i])
188
+ // }
189
+ for ( let i = 0 ; i < 100 ; i ++ ) {
190
+ //let newRow = tableRef.insertRow(-1)
191
+ //newRow.innerHTML = appendChild()
192
+ //this.setAttribute('key', i)
193
+
194
+ this . tbody . append ( this . tr [ i ] )
195
+ }
196
+ for ( let i = 100 ; i < len ; i ++ ) {
186
197
let newRow = tableRef . insertRow ( - 1 )
187
- newRow . parentElement . replaceChild ( tr [ i ] , newRow )
198
+ newRow . innerHTML = this . tr [ i ] . childNodes [ 0 ] . outerHTML
199
+ // this.tbody.append(this.tr[i])
188
200
}
189
- // this.tbody = this.shadow.querySelector('#tbody')
201
+
202
+
203
+ // this.tbody.childNodes[len-1].scrollIntoView()
204
+ setTimeout ( ( ) => {
205
+ for ( let i = 100 ; i < len ; i ++ ) {
206
+ //let newRow = tableRef.insertRow(-1)
207
+ //newRow.innerHTML = appendChild()
208
+ this . setAttribute ( 'key' , i )
209
+
210
+ // this.tbody.append(tr[i])
211
+ }
212
+ } , 1 )
213
+
214
+
215
+
216
+ // this.tbody = this.shadow.querySelector('#tbody')
190
217
// elem.textContent = ''
191
218
// this.lastRun = elem
192
219
// this.tbody.childNodes[len-1].scrollIntoView()
0 commit comments