i have a doubt, i use gridapi.getfilterinstance in the angular app it works fine.
but the main problem is that i create a custom search box and i have two columns in grid table firstname and lastname
i want to search in both of them. what i create is
onSearch() {
const row = this.reportTable.gridApi.getFilterInstance('contact.firstName');
let filter = this.form.value['text'];
let condition = {
type: 'startsWith',
filter
};
row.setModel(condition);
this.reportTable.gridApi.onFilterChanged();
}
<button class="primary-btn mr-2" (click)="onSearch()">
Search
</button>
i need another condition with this firstname instance i,e. contact.lastName which is trigger with the same search button and search field.
I would suggest using an external filter. This enables you to search based on whatever condition you want. In your case this would be against firstName and lastName. Main steps are:
isExternalFilterPresentdoesExternalFilterPass with your custom logic.I have created a plunkr based of the documentation example that shows filtering based off both the athlete name or country.