1

I am using angular5-data-table with my angular 5 application.(https://www.npmjs.com/package/angular5-data-table)

This is my code

    <div class="col-md-12">
      <data-table id="my-table"
            title = "Test Table"
            [items] = "testData"
            [itemCount] = "testCount"
            [expandableRows]="true"
            [substituteRows]="false"
            [sortAsc]="true"
            [limit]=10
      >
            <data-table-column
                  [property]="'name'"
                  [header]="'Name'"
                  [sortable]="true">
            </data-table-column>
            <data-table-column
                  [property]="'age'"
                  [header]="'Age'"
                  [sortable]="true">
            </data-table-column>
      </data-table>
</div>

This is my output

Here i set rows limit as 10. But it showing all the data. In the bottom of the table Result is saying '1 to 10 of 12' but it's showing all the rows. Also it's not supporting with sorting.

Angular CLI: 1.7.4 Node: 8.11.1 OS: win32 x64 Angular: 5.2.10

1 Answer 1

1

Handle reload event in your data-table

In your HTML

<data-table (reload)="reloadItems($event)">

In your component

reloadItems(params){
    if(!this.tableResource) return;
    this.tableResource.query(params).then(items => this.items = items);
}
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.