@@ -20,7 +20,8 @@ export default class CellManager {
20
20
'columnmanager' ,
21
21
'rowmanager' ,
22
22
'datamanager' ,
23
- 'keyboard'
23
+ 'keyboard' ,
24
+ 'footer'
24
25
] ) ;
25
26
26
27
this . bindEvents ( ) ;
@@ -172,6 +173,14 @@ export default class CellManager {
172
173
mouseDown = false ;
173
174
} ) ;
174
175
176
+ if ( this . options . showTotalRow ) {
177
+ $ . on ( this . footer , 'click' , '.dt-cell' , ( e ) => {
178
+
179
+ this . focusCell ( $ ( e . delegatedTarget ) ) ;
180
+ } ) ;
181
+
182
+ }
183
+
175
184
const selectArea = ( e ) => {
176
185
if ( ! mouseDown ) return ;
177
186
this . selectArea ( $ ( e . delegatedTarget ) ) ;
@@ -552,10 +561,18 @@ export default class CellManager {
552
561
// copy only focusedCell
553
562
const {
554
563
colIndex,
555
- rowIndex
564
+ rowIndex,
565
+ isTotalRow
556
566
} = $ . data ( $cell1 ) ;
557
- const cell = this . getCell ( colIndex , rowIndex ) ;
558
- copyTextToClipboard ( cell . content ) ;
567
+ let copiedContent = '' ;
568
+ if ( isTotalRow ) {
569
+ let choosenFooterCell = this . $focusedCell ;
570
+ copiedContent = choosenFooterCell . children [ 0 ] . title ;
571
+ } else {
572
+ const cell = this . getCell ( colIndex , rowIndex ) ;
573
+ copiedContent = cell . content ;
574
+ }
575
+ copyTextToClipboard ( copiedContent ) ;
559
576
return 1 ;
560
577
}
561
578
const cells = this . getCellsInRange ( $cell1 , $cell2 ) ;
@@ -754,7 +771,7 @@ export default class CellManager {
754
771
}
755
772
756
773
scrollToCell ( $cell ) {
757
- if ( $ . inViewport ( $cell , this . bodyScrollable ) ) return false ;
774
+ if ( $ . inViewport ( $cell , this . bodyScrollable ) || $ . inViewport ( $cell , this . footer ) ) return false ;
758
775
759
776
const {
760
777
rowIndex
0 commit comments