@@ -117,7 +117,6 @@ Doo.define(
117
117
this . tbody . textContent = ''
118
118
this . renderTable ( )
119
119
e . target . blur ( )
120
-
121
120
stop ( 'run' )
122
121
}
123
122
@@ -131,51 +130,13 @@ Doo.define(
131
130
e . target . blur ( )
132
131
stop ( 'runAppend' )
133
132
}
134
-
135
- appendData ( containerElem , start ) {
136
- let elem = document . createElement ( 'tbody' )
137
- elem . id = 'tbody'
138
- let len = this . data [ this . defaultDataSet ] . length // TODO read dataset name from an attribute on place[n]
139
- elem . innerHTML = this . renderNode ( this . place [ 0 ] , this . data . rows , start , len )
140
- this . tableRows = elem . querySelectorAll ( 'tr' )
141
-
142
- for ( let i = start ; i < len ; i ++ ) {
143
- containerElem . appendChild ( this . tableRows [ i - start ] )
144
- }
145
- }
146
133
147
134
async attributeChangedCallback ( name , oldVal , i ) {
148
135
if ( name === 'key' ) {
149
136
this . tbody . replaceChild ( this . tableRows [ i ] , this . tbody . childNodes [ i ] )
150
137
}
151
138
}
152
139
153
- async renderTable ( dataSet = this . data [ this . defaultDataSet ] , start = 0 ) {
154
-
155
- let tableRef = this . place [ 0 ] . parentElement
156
-
157
- let elem = document . createElement ( 'tbody' )
158
- elem . id = 'tbody'
159
- let len = dataSet . length
160
- elem . innerHTML = this . renderNode ( this . place [ 0 ] , this . data . rows , start , len )
161
- this . tableRows = elem . querySelectorAll ( 'tr' )
162
-
163
- for ( let i = start ; i < this . PAGE_SIZE ; i ++ ) {
164
- this . tbody . appendChild ( this . tableRows [ i ] )
165
- }
166
- for ( let i = this . PAGE_SIZE ; i < len ; i ++ ) {
167
- let newRow = tableRef . insertRow ( - 1 )
168
- newRow . innerHTML = this . tableRows [ i ] . childNodes [ 0 ] . outerHTML
169
- }
170
-
171
- setTimeout ( ( ) => {
172
- for ( let i = 100 ; i < len ; i ++ ) {
173
- this . setAttribute ( 'key' , i )
174
- }
175
- } , 1 )
176
- return
177
- }
178
-
179
140
runLots ( ) {
180
141
this . data . rows = this . buildData ( 10000 )
181
142
this . tbody . textContent = ''
0 commit comments