File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
dist/extensions/fixed-columns
src/extensions/fixed-columns Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 169169 this . $tableBody . css ( "height" , "100%" ) ;
170170 this . $fixedColumns && this . $fixedColumns . show ( ) ;
171171 this . $fixedColumnsRight && this . $fixedColumnsRight . show ( ) ;
172- this . $fixedHeaderRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
173- this . $fixedBodyRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
172+ this . $fixedHeaderRight && this . $fixedHeaderRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
173+ this . $fixedBodyRight && this . $fixedBodyRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
174174 }
175175 }
176176 if ( ! that . fixedColumnsSupported ( ) ) {
177177 return ;
178178 }
179179 if ( arguments [ 0 ] === 'post-header' ) {
180+ if ( ! this . $fixedColumns && ! this . $fixedColumnsRight ) {
181+ this . initFixedContainer ( ) ;
182+ }
180183 this . initFixedColumnsHeader ( ) ;
181184 } else if ( arguments [ 0 ] === 'scroll-body' ) {
182185 if ( this . needFixedColumns && this . options . fixedNumber ) {
183- this . $fixedBody . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
186+ this . $fixedBody && this . $fixedBody . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
184187 }
185188
186189 if ( this . needFixedColumns && this . options . fixedRightNumber ) {
187- this . $fixedBodyRight . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
190+ this . $fixedBodyRight && this . $fixedBodyRight . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
188191 }
189192 } else if ( arguments [ 0 ] === 'load-success' ) {
190193 this . hideLoading ( ) ;
Original file line number Diff line number Diff line change 169169 this . $tableBody . css ( "height" , "100%" ) ;
170170 this . $fixedColumns && this . $fixedColumns . show ( ) ;
171171 this . $fixedColumnsRight && this . $fixedColumnsRight . show ( ) ;
172- this . $fixedHeaderRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
173- this . $fixedBodyRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
172+ this . $fixedHeaderRight && this . $fixedHeaderRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
173+ this . $fixedBodyRight && this . $fixedBodyRight . scrollLeft ( this . $tableBody . find ( 'table' ) . width ( ) ) ;
174174 }
175175 }
176176 if ( ! that . fixedColumnsSupported ( ) ) {
177177 return ;
178178 }
179179 if ( arguments [ 0 ] === 'post-header' ) {
180+ if ( ! this . $fixedColumns && ! this . $fixedColumnsRight ) {
181+ this . initFixedContainer ( ) ;
182+ }
180183 this . initFixedColumnsHeader ( ) ;
181184 } else if ( arguments [ 0 ] === 'scroll-body' ) {
182185 if ( this . needFixedColumns && this . options . fixedNumber ) {
183- this . $fixedBody . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
186+ this . $fixedBody && this . $fixedBody . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
184187 }
185188
186189 if ( this . needFixedColumns && this . options . fixedRightNumber ) {
187- this . $fixedBodyRight . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
190+ this . $fixedBodyRight && this . $fixedBodyRight . scrollTop ( this . $tableBody . scrollTop ( ) ) ;
188191 }
189192 } else if ( arguments [ 0 ] === 'load-success' ) {
190193 this . hideLoading ( ) ;
You can’t perform that action at this time.
0 commit comments