File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import HyperList from 'hyperlist' ;
2+
23export default class BodyRenderer {
34 constructor ( instance ) {
45 this . instance = instance ;
@@ -14,10 +15,9 @@ export default class BodyRenderer {
1415 renderRows ( rows ) {
1516 this . visibleRows = rows ;
1617 this . visibleRowIndices = rows . map ( row => row . meta . rowIndex ) ;
17- this . instance . noData = false ;
18+
1819 if ( rows . length === 0 ) {
1920 this . bodyScrollable . innerHTML = this . getNoDataHTML ( ) ;
20- this . instance . noData = true ;
2121 this . footer . innerHTML = '' ;
2222 return ;
2323 }
@@ -140,18 +140,7 @@ export default class BodyRenderer {
140140 }
141141
142142 getNoDataHTML ( ) {
143- const width = this . instance . header . scrollWidth ;
144- const height = this . bodyScrollable . clientHeight ;
145- return `
146- <div
147- class="dt-scrollable__no-data"
148- style="width: ${ width - 2 } px; height: ${ height } px"
149- >
150- <div class="dt-scrollable__no-data no-data-message">
151- ${ this . options . noDataMessage }
152- </div>
153- </div>
154- ` ;
143+ return `<div class="dt-scrollable__no-data">${ this . options . noDataMessage } </div>` ;
155144 }
156145
157146 getToastMessageHTML ( message ) {
Original file line number Diff line number Diff line change 1616 --dt-selection-highlight-color : var (--dt-light-yellow );
1717 --dt-toast-message-border : none;
1818 --dt-header-cell-bg : var (--dt-cell-bg );
19- --dt-no-data-message-width : 90px ;
2019}
2120
2221.datatable {
5554 padding : var (--dt-spacer-3 );
5655 border-left : 1px solid var (--dt-border-color );
5756 border-right : 1px solid var (--dt-border-color );
58- .no-data-message {
59- position : absolute;
60- top : 100px ;
61- left : 50px ;
62- border : none;
63- width : var (--dt-no-data-message-width );
64- }
6557 }
66-
6758}
6859
6960.dt-row {
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export default class Style {
7777 // Find corresponding footer cell
7878 const footerCell = this . footer . querySelector ( `.dt-cell[data-col-index="${ colIndex } "]` ) ;
7979
80- if ( bodyCell && ~ ~ ( bodyCell . offsetLeft - scrollLeft ) > colLeft ) {
80+ if ( ~ ~ ( bodyCell . offsetLeft - scrollLeft ) > colLeft ) {
8181 headerCell . style . transform = `translateX(${ - scrollLeft - 1 } px)` ;
8282 if ( footerCell ) {
8383 footerCell . style . transform = `translateX(${ scrollLeft ? - scrollLeft - 1 : 0 } px)` ;
@@ -89,12 +89,6 @@ export default class Style {
8989 } ) ;
9090
9191 this . _settingHeaderPosition = false ;
92- if ( this . instance . noData ) {
93- $ . style ( $ ( '.no-data-message' ) , {
94- left : `${ this . instance . wrapper . clientWidth / 2 - ( - scrollLeft ) } px`
95- } ) ;
96- }
97- this . _settingHeaderPosition = false ;
9892 } ) ;
9993 } ) ;
10094 }
You can’t perform that action at this time.
0 commit comments