@@ -125,7 +125,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
125125 this . _columnPinning = this . grid . onColumnPinning . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
126126 requestAnimationFrame ( ( ) => {
127127 if ( ! ( this . cdr as ViewRef ) . destroyed ) {
128- this . cdr . detectChanges ( ) ;
128+ this . cdr . detectChanges ( ) ;
129129 }
130130 } ) ;
131131 } ) ;
@@ -189,7 +189,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
189189 */
190190 @Input ( )
191191 get minHeight ( ) : string {
192- if ( this . _minHeight || this . _minHeight === 0 ) {
192+ if ( this . _minHeight || this . _minHeight === 0 ) {
193193 return this . _minHeight ;
194194 }
195195
@@ -406,20 +406,20 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
406406 private areExpressionsSelectable ( ) {
407407 if ( this . expressionsList . length === 1 &&
408408 ( this . expressionsList [ 0 ] . expression . condition . name === 'equals' ||
409- this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
410- this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
411- this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
412- this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
409+ this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
410+ this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
411+ this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
412+ this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
413413 return true ;
414414 }
415415
416416 const selectableExpressionsCount = this . expressionsList . filter ( exp =>
417417 ( exp . beforeOperator === 1 || exp . afterOperator === 1 ) &&
418418 ( exp . expression . condition . name === 'equals' ||
419- exp . expression . condition . name === 'true' ||
420- exp . expression . condition . name === 'false' ||
421- exp . expression . condition . name === 'empty' ||
422- exp . expression . condition . name === 'in' ) ) . length ;
419+ exp . expression . condition . name === 'true' ||
420+ exp . expression . condition . name === 'false' ||
421+ exp . expression . condition . name === 'empty' ||
422+ exp . expression . condition . name === 'in' ) ) . length ;
423423
424424 return selectableExpressionsCount === this . expressionsList . length ;
425425 }
@@ -459,7 +459,12 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
459459 this . loadingStart . emit ( ) ;
460460 const expressionsTree : FilteringExpressionsTree = this . getColumnFilterExpressionsTree ( ) ;
461461
462+ const prevColumn = this . column ;
462463 this . grid . uniqueColumnValuesStrategy ( this . column , expressionsTree , ( colVals : any [ ] ) => {
464+ if ( ! this . column || this . column !== prevColumn ) {
465+ return ;
466+ }
467+
463468 const columnValues = ( this . column . dataType === DataType . Date ) ?
464469 colVals . map ( val => val ? val . toDateString ( ) : val ) : colVals ;
465470
@@ -496,7 +501,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
496501 if ( this . column . dataType === DataType . String && this . column . filteringIgnoreCase ) {
497502 const filteredUniqueValues = columnValues . map ( s => s ?. toString ( ) . toLowerCase ( ) )
498503 . reduce ( ( map , val , i ) => map . get ( val ) ? map : map . set ( val , columnValues [ i ] ) ,
499- new Map ) ;
504+ new Map ) ;
500505
501506 this . uniqueValues = Array . from ( filteredUniqueValues . values ( ) ) ;
502507 } else {
0 commit comments