@@ -126,7 +126,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
126126 this . _columnPinning = this . grid . onColumnPinning . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
127127 requestAnimationFrame ( ( ) => {
128128 if ( ! ( this . cdr as ViewRef ) . destroyed ) {
129- this . cdr . detectChanges ( ) ;
129+ this . cdr . detectChanges ( ) ;
130130 }
131131 } ) ;
132132 } ) ;
@@ -190,7 +190,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
190190 */
191191 @Input ( )
192192 get minHeight ( ) : string {
193- if ( this . _minHeight || this . _minHeight === 0 ) {
193+ if ( this . _minHeight || this . _minHeight === 0 ) {
194194 return this . _minHeight ;
195195 }
196196
@@ -413,20 +413,20 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
413413 private areExpressionsSelectable ( ) {
414414 if ( this . expressionsList . length === 1 &&
415415 ( this . expressionsList [ 0 ] . expression . condition . name === 'equals' ||
416- this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
417- this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
418- this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
419- this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
416+ this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
417+ this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
418+ this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
419+ this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
420420 return true ;
421421 }
422422
423423 const selectableExpressionsCount = this . expressionsList . filter ( exp =>
424424 ( exp . beforeOperator === 1 || exp . afterOperator === 1 ) &&
425425 ( exp . expression . condition . name === 'equals' ||
426- exp . expression . condition . name === 'true' ||
427- exp . expression . condition . name === 'false' ||
428- exp . expression . condition . name === 'empty' ||
429- exp . expression . condition . name === 'in' ) ) . length ;
426+ exp . expression . condition . name === 'true' ||
427+ exp . expression . condition . name === 'false' ||
428+ exp . expression . condition . name === 'empty' ||
429+ exp . expression . condition . name === 'in' ) ) . length ;
430430
431431 return selectableExpressionsCount === this . expressionsList . length ;
432432 }
@@ -466,7 +466,12 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
466466 this . loadingStart . emit ( ) ;
467467 const expressionsTree : FilteringExpressionsTree = this . getColumnFilterExpressionsTree ( ) ;
468468
469+ const prevColumn = this . column ;
469470 this . grid . uniqueColumnValuesStrategy ( this . column , expressionsTree , ( colVals : any [ ] ) => {
471+ if ( ! this . column || this . column !== prevColumn ) {
472+ return ;
473+ }
474+
470475 const columnValues = ( this . column . dataType === DataType . Date ) ?
471476 colVals . map ( val => val ? val . toDateString ( ) : val ) : colVals ;
472477
@@ -503,7 +508,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
503508 if ( this . column . dataType === DataType . String && this . column . filteringIgnoreCase ) {
504509 const filteredUniqueValues = columnValues . map ( s => s ?. toString ( ) . toLowerCase ( ) )
505510 . reduce ( ( map , val , i ) => map . get ( val ) ? map : map . set ( val , columnValues [ i ] ) ,
506- new Map ) ;
511+ new Map ) ;
507512
508513 this . uniqueValues = Array . from ( filteredUniqueValues . values ( ) ) ;
509514 } else {
@@ -591,9 +596,9 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
591596 filterListItem . isFiltered = true ;
592597 this . selectAllIndeterminate = true ;
593598 } else if ( element === false && this . expressionsList . find ( exp => exp . expression . condition . name === 'false' ) ) {
594- filterListItem . isSelected = true ;
595- filterListItem . isFiltered = true ;
596- this . selectAllIndeterminate = true ;
599+ filterListItem . isSelected = true ;
600+ filterListItem . isFiltered = true ;
601+ this . selectAllIndeterminate = true ;
597602 } else {
598603 filterListItem . isSelected = false ;
599604 filterListItem . isFiltered = false ;
0 commit comments