@@ -131,43 +131,39 @@ export class IgxExcelStyleConditionalFilterComponent implements OnDestroy {
131131 const overlaySettings : OverlaySettings = {
132132 modal : false ,
133133 closeOnOutsideClick : true ,
134- positionStrategy : new ContainerPositionStrategy ( ) ,
135- scrollStrategy : new AbsoluteScrollStrategy ( )
134+ positionStrategy : new ContainerPositionStrategy ( )
136135 } ;
137136 const overlayId = this . _overlayService . attach ( IgxExcelStyleCustomDialogComponent , this . esf . grid . viewRef , overlaySettings ) ;
138137 const overlayInfo = this . _overlayService . getOverlayById ( overlayId ) ;
139138 const customDialog = overlayInfo . componentRef . instance as IgxExcelStyleCustomDialogComponent ;
140139 this . esf . grid . tbody . nativeElement . appendChild ( overlayInfo . wrapperElement . parentElement ) ;
141140
141+ customDialog . esf = this . esf ;
142+ customDialog . column = this . esf . column ;
143+ customDialog . filteringService = this . esf . grid . filteringService ;
144+ customDialog . overlayComponentId = overlayId ;
145+ if ( this . esf . expressionsList && this . esf . expressionsList . length &&
146+ this . esf . expressionsList [ 0 ] . expression . condition . name !== 'in' ) {
147+ customDialog . expressionsList = this . esf . expressionsList ;
148+ } else {
149+ customDialog . expressionsList = customDialog . expressionsList . filter ( e => e . expression . fieldName === this . esf . column . field && e . expression . condition ) ;
150+ }
151+ customDialog . selectedOperator = eventArgs . newSelection . value ;
152+
142153 this . _overlayService . opening . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( args ) => {
143- if ( args . id === overlayId ) {
144- customDialog . esf = this . esf ;
145- customDialog . column = this . esf . column ;
146- customDialog . filteringService = this . esf . grid . filteringService ;
147- customDialog . overlayComponentId = overlayId ;
148- customDialog . selectedOperator = eventArgs . newSelection . value ;
149- if ( this . esf . expressionsList && this . esf . expressionsList . length &&
150- this . esf . expressionsList [ 0 ] . expression . condition . name !== 'in' ) {
151- customDialog . expressionsList = this . esf . expressionsList ;
152- } else {
153- customDialog . expressionsList = customDialog . expressionsList
154- . filter ( e => e . expression . fieldName === this . esf . column . field && e . expression . condition ) ;
155- }
154+ if ( args . id === overlayId )
156155 customDialog . onCustomDialogOpening ( ) ;
157- }
158156 } ) ;
159157 this . _overlayService . opened . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( args ) => {
160- if ( args . id === overlayId ) {
158+ if ( args . id === overlayId )
161159 customDialog . onCustomDialogOpened ( ) ;
162- }
163160 } ) ;
164161
165162 eventArgs . cancel = true ;
166163 if ( this . esf . overlayComponentId ) {
167164 this . esf . hide ( ) ;
168165 }
169166 this . subMenu . close ( ) ;
170-
171167 this . _overlayService . show ( overlayId ) ;
172168 }
173169
0 commit comments