Skip to content

Commit

Permalink
added onClearFilter method and cloSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
pragati-atharva committed Sep 22, 2022
1 parent d601718 commit 7ce19ea
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/app/shared/components/table/table.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { HttpClient } from '@angular/common/http';
import {
Component,
ElementRef,
EventEmitter,
HostListener,
Input,
Output,
ViewChild,
} from '@angular/core';
import { IFilter } from 'src/app/core/shared/models/filter';
import { CommonService } from 'src/app/core/shared/services/common/common.service';
Expand All @@ -30,7 +28,7 @@ export class TableComponent {
@Output() onEditEvent = new EventEmitter<any>();
@Output() onDeleteEvent = new EventEmitter<any>();
@Input() newRowsData: any;
@ViewChild('searchText') searchText: any;
@Input() colspan!: number;

selectedIds: any = [];
isChecked = false;
Expand All @@ -45,14 +43,12 @@ export class TableComponent {
@Output() onPageSizeChangeEvent = new EventEmitter<any>();

filterAttributes;

//Constants
public constant;
public svgs;

constructor(
private commonService: CommonService,
private http: HttpClient,
private _eref: ElementRef
) {
constructor(private commonService: CommonService, private _eref: ElementRef) {
this.filterAttributes = this.commonService.filterAttributes;
this.constant = ConstantClass;
this.svgs = SVGs;
Expand Down Expand Up @@ -154,9 +150,14 @@ export class TableComponent {
}

//On search box Key Enter
onKeyupOnSearch(event: any) {
onKeyupOnSearch(event?: any) {
this.p = 1;
this.onSearchingEvent.emit(event.target.value);
this.onSearchingEvent.emit(ConstantClass.table.searchText);
}

onClearFilter() {
ConstantClass.table.searchText = '';
this.onKeyupOnSearch();
}

//To add employee
Expand Down

0 comments on commit 7ce19ea

Please sign in to comment.