File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
projects/igniteui-angular/src/lib/grids/pivot-grid Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,23 @@ export class IgxPivotFilteringService extends IgxFilteringService {
3030 ( grid as any ) . setupColumns ( ) ;
3131 }
3232 }
33+ public clearFilter ( field : string ) : void {
34+ this . clear_filter ( field ) ;
35+ }
36+
37+ public clear_filter ( fieldName : string ) {
38+ super . clear_filter ( fieldName ) ;
39+ const grid = this . grid ;
40+ const config = ( grid as IgxPivotGridComponent ) . pivotConfiguration ;
41+ const allDimensions = PivotUtil . flatten ( config . rows . concat ( config . columns ) . concat ( config . filters ) . filter ( x => x !== null ) ) ;
42+ const enabledDimensions = allDimensions . filter ( x => x && x . enabled ) ;
43+ const dim = enabledDimensions . find ( x => x . fieldName === fieldName || x . member === fieldName ) ;
44+ dim . filters = undefined ;
45+ grid . filteringPipeTrigger ++ ;
46+ if ( PivotUtil . flatten ( config . columns ) . indexOf ( dim ) !== - 1 ) {
47+ // update columns
48+ ( grid as any ) . setupColumns ( ) ;
49+ }
50+ }
3351
3452}
You can’t perform that action at this time.
0 commit comments