1

I have developed a paginating datatable component in my angular2 application with the help of this git code: https://github.com/mariuszfoltak/angular2-datatable

To achieve search/filter functionality for this I have created a pipe and passed it to template as below:

<tr *ngFor="let item of mf.data | filterPipe: searchTerm">

Search is working fine but the pagination at the bottom of the page is not updated. I think this will work if I can update 'data'. Can I get any suggestions to solve this issue.

1 Answer 1

1

Try using the filter directly on [mfData] as code below.

<table class="table table-striped" [mfData]="(singleData | search:searchText)" #mf="mfDataTable" [mfRowsOnPage]="10">

.
.
.
</table>

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.