0

Is there any way we can invoke any function while we any value is entered in angular material data table filter field? As we want to maintain the column current index value while we filter for result. We are using Angular 6 for our project.

2
  • Can you please be more specific? Commented Apr 30, 2019 at 5:12
  • Yes we can invoke a function on value entering into angular material data table filter field like <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter"> Commented Apr 30, 2019 at 5:14

1 Answer 1

2

If you're having a problem with accessing the correct index after filtering the data table, make sure you're using the filteredData property, and not the data property.

For example;

data: this.dataSource.filteredData[index]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.