@@ -188,38 +188,20 @@ const data: RecordType[] = new Array(4 * 10000).fill(null).map((_, index) => ({
188
188
// ],
189
189
} ) ) ;
190
190
191
- const Demo = ( ) => {
192
- const table1Ref = React . useRef < Reference > ( ) ;
193
- const table2Ref = React . useRef < Reference > ( ) ;
191
+ const Demo : React . FC = ( ) => {
192
+ const tableRef = React . useRef < Reference > ( ) ;
194
193
return (
195
194
< div style = { { width : 800 , padding : `0 64px` } } >
196
- < button
197
- onClick = { ( ) => {
198
- table1Ref . current ?. scrollTo ( { top : 9999999999999 } ) ;
199
- table2Ref . current ?. scrollTo ( { top : 9999999999999 } ) ;
200
- } }
201
- >
195
+ < button onClick = { ( ) => tableRef . current ?. scrollTo ( { top : 9999999999999 } ) } >
202
196
Scroll To End
203
197
</ button >
204
- < button
205
- onClick = { ( ) => {
206
- table1Ref . current ?. scrollTo ( { top : 0 } ) ;
207
- table2Ref . current ?. scrollTo ( { top : 0 } ) ;
208
- } }
209
- >
210
- Scroll To Start
211
- </ button >
212
- < button
213
- onClick = { ( ) => {
214
- table1Ref . current ?. scrollTo ( { index : data . length - 1 } ) ;
215
- table2Ref . current ?. scrollTo ( { index : data . length - 1 } ) ;
216
- } }
217
- >
198
+ < button onClick = { ( ) => tableRef . current ?. scrollTo ( { top : 0 } ) } > Scroll To Start</ button >
199
+ < button onClick = { ( ) => tableRef . current ?. scrollTo ( { index : data . length - 1 } ) } >
218
200
Scroll To Key
219
201
</ button >
220
202
< VirtualTable
221
203
style = { { marginTop : 16 } }
222
- ref = { table1Ref }
204
+ ref = { tableRef }
223
205
columns = { columns }
224
206
// expandedRowRender={({ b, c }) => b || c}
225
207
scroll = { { x : 1300 , y : 200 } }
@@ -240,29 +222,6 @@ const Demo = () => {
240
222
return mergedWidth ;
241
223
} }
242
224
/>
243
- < VirtualTable
244
- style = { { marginTop : 16 } }
245
- ref = { table2Ref }
246
- columns = { columns }
247
- // expandedRowRender={({ b, c }) => b || c}
248
- scroll = { { x : 1300 , y : 200 } }
249
- data = { data }
250
- // data={[]}
251
- rowKey = "indexKey"
252
- expandable = { {
253
- expandedRowRender : ( ) => 2333 ,
254
- columnWidth : 60 ,
255
- expandedRowClassName : 'good-one-string' ,
256
- } }
257
- // onRow={() => ({ className: 'rowed' })}
258
- rowClassName = "nice-try"
259
- getContainerWidth = { ( ele , width ) => {
260
- // Minus border
261
- const { borderInlineStartWidth } = getComputedStyle ( ele . querySelector ( '.rc-table-tbody' ) ) ;
262
- const mergedWidth = width - parseInt ( borderInlineStartWidth , 10 ) ;
263
- return mergedWidth ;
264
- } }
265
- />
266
225
</ div >
267
226
) ;
268
227
} ;
0 commit comments