@@ -24,6 +24,7 @@ import {
2424 IgxGridFilteringESFEmptyTemplatesComponent ,
2525 IgxGridFilteringESFTemplatesComponent ,
2626 IgxGridFilteringESFLoadOnDemandComponent ,
27+ IgxGridFilteringESFRemoteChunkComponent ,
2728 CustomFilteringStrategyComponent ,
2829 IgxGridExternalESFComponent ,
2930 IgxGridExternalESFTemplateComponent ,
@@ -3223,6 +3224,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
32233224 IgxGridFilteringESFEmptyTemplatesComponent ,
32243225 IgxGridFilteringESFTemplatesComponent ,
32253226 IgxGridFilteringESFLoadOnDemandComponent ,
3227+ IgxGridFilteringESFRemoteChunkComponent ,
32263228 IgxGridFilteringMCHComponent ,
32273229 IgxGridExternalESFComponent ,
32283230 IgxGridExternalESFTemplateComponent
@@ -7068,6 +7070,40 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
70687070 tick ( 2000 ) ;
70697071 } ) . not . toThrowError ( / ' d a t a T y p e ' o f n u l l / ) ;
70707072 } ) ) ;
7073+
7074+ it ( 'Should preserve selected string values from full remote set when grid data is chunked' , fakeAsync ( ( ) => {
7075+ const remoteFix = TestBed . createComponent ( IgxGridFilteringESFRemoteChunkComponent ) ;
7076+ const remoteGrid = remoteFix . componentInstance . grid ;
7077+ remoteFix . detectChanges ( ) ;
7078+
7079+ // Mark the grid as remote so ESF does not derive selected values from the current data chunk.
7080+ remoteGrid . totalItemCount = remoteFix . componentInstance . fullData . length ;
7081+
7082+ GridFunctions . clickExcelFilterIcon ( remoteFix , 'ProductName' ) ;
7083+ tick ( 100 ) ;
7084+ remoteFix . detectChanges ( ) ;
7085+
7086+ const excelMenu = GridFunctions . getExcelStyleFilteringComponent ( remoteFix ) ;
7087+ const labelElements : any [ ] = Array . from ( GridFunctions . getExcelStyleSearchComponentListItems ( remoteFix , excelMenu ) ) ;
7088+ const checkboxElements : any [ ] = Array . from ( GridFunctions . getExcelStyleFilteringCheckboxes ( remoteFix , excelMenu ) ) ;
7089+
7090+ const uncheckLabel = 'Alpha' ;
7091+ const uncheckIndex = labelElements . findIndex ( el => el . innerText === uncheckLabel ) ;
7092+ expect ( uncheckIndex ) . toBeGreaterThan ( 0 ) ;
7093+
7094+ checkboxElements [ uncheckIndex ] . click ( ) ;
7095+ remoteFix . detectChanges ( ) ;
7096+
7097+ GridFunctions . clickApplyExcelStyleFiltering ( remoteFix , excelMenu , 'igx-grid' ) ;
7098+ remoteFix . detectChanges ( ) ;
7099+
7100+ const tree = remoteGrid . filteringExpressionsTree . filteringOperands [ 0 ] as IFilteringExpressionsTree ;
7101+ const operand = tree . filteringOperands [ 0 ] as IFilteringExpression ;
7102+
7103+ const selectedValues = Array . from ( ( operand . searchVal as Set < string > ) . values ( ) ) ;
7104+ expect ( selectedValues ) . toEqual ( jasmine . arrayContaining ( [ 'beta' , 'Gamma' , 'DELTA' ] ) ) ;
7105+ expect ( selectedValues ) . not . toContain ( 'Alpha' ) ;
7106+ } ) ) ;
70717107 } ) ;
70727108
70737109 describe ( null , ( ) => {
0 commit comments