@@ -155,7 +155,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
155155 requestAnimationFrame ( ( ) => {
156156 this . isColumnPinnable = this . column . pinnable ;
157157 if ( ! ( this . cdr as ViewRef ) . destroyed ) {
158- this . cdr . detectChanges ( ) ;
158+ this . cdr . detectChanges ( ) ;
159159 }
160160 } ) ;
161161 } ) ;
@@ -528,20 +528,20 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
528528 private areExpressionsSelectable ( ) {
529529 if ( this . expressionsList . length === 1 &&
530530 ( this . expressionsList [ 0 ] . expression . condition . name === 'equals' ||
531- this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
532- this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
533- this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
534- this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
531+ this . expressionsList [ 0 ] . expression . condition . name === 'true' ||
532+ this . expressionsList [ 0 ] . expression . condition . name === 'false' ||
533+ this . expressionsList [ 0 ] . expression . condition . name === 'empty' ||
534+ this . expressionsList [ 0 ] . expression . condition . name === 'in' ) ) {
535535 return true ;
536536 }
537537
538538 const selectableExpressionsCount = this . expressionsList . filter ( exp =>
539539 ( exp . beforeOperator === 1 || exp . afterOperator === 1 ) &&
540540 ( exp . expression . condition . name === 'equals' ||
541- exp . expression . condition . name === 'true' ||
542- exp . expression . condition . name === 'false' ||
543- exp . expression . condition . name === 'empty' ||
544- exp . expression . condition . name === 'in' ) ) . length ;
541+ exp . expression . condition . name === 'true' ||
542+ exp . expression . condition . name === 'false' ||
543+ exp . expression . condition . name === 'empty' ||
544+ exp . expression . condition . name === 'in' ) ) . length ;
545545
546546 return selectableExpressionsCount === this . expressionsList . length ;
547547 }
@@ -581,7 +581,12 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
581581 this . excelStyleSearch . isLoading = true ;
582582 const expressionsTree : FilteringExpressionsTree = this . getColumnFilterExpressionsTree ( ) ;
583583
584+ const prevColumn = this . column ;
584585 this . grid . uniqueColumnValuesStrategy ( this . column , expressionsTree , ( colVals : any [ ] ) => {
586+ if ( ! this . column || this . column !== prevColumn ) {
587+ return ;
588+ }
589+
585590 const columnValues = ( this . column . dataType === DataType . Date ) ?
586591 colVals . map ( val => val ? val . toDateString ( ) : val ) : colVals ;
587592
@@ -618,7 +623,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy {
618623 if ( this . column . dataType === DataType . String && this . column . filteringIgnoreCase ) {
619624 const filteredUniqueValues = columnValues . map ( s => s ?. toString ( ) . toLowerCase ( ) )
620625 . reduce ( ( map , val , i ) => map . get ( val ) ? map : map . set ( val , columnValues [ i ] ) ,
621- new Map ) ;
626+ new Map ) ;
622627
623628 this . uniqueValues = Array . from ( filteredUniqueValues . values ( ) ) ;
624629 } else {
0 commit comments