I am using ng2-smart-table. I used the custom filter and rendered same button in both the filter. But I am confused how to know which button is clicked.?
This is the component of the button.
@Component({
template: `
<button (click)="onClick()">Select Range</button>
`,
})
export class RangeFilterComponent extends DefaultFilter implements OnInit {
inputControl = new FormControl();
constructor(private dialogService: NbDialogService) {
super();
}
ngOnInit() {
}
onClick=()=>{
this.dialogService.open(ShowcaseDialogComponent, {
context: {
title: 'Select Range',
},
});
}
}
This is the settings of ng2-smart-table where i have rendered the button
columns: {
name: {
title: 'Project Name',
type: 'string',
},
description: {
title: 'Description',
type: 'string',
},
type: {
title: 'Project Type',
type: 'string',
},
scheme: {
title: 'Scheme',
type: 'string',
},
assigned_to: {
title: 'Engineer',
type: 'string',
},
assigned_contractor: {
title: 'Contractor',
type: 'string',
},
cost_disbursement: {
title: 'Cost Disbursement',
filter:{
type: 'custom',
component: RangeFilterComponent
}
},
physical_progress: {
title: 'Physical Progress',
filter:{
type: 'custom',
component: RangeFilterComponent
}
},