javascript - ngx-datatable Configurable Paging Parameter -


i building datatable ngx-datatable , activated paging [limit]="10" example. works fine. however, want make entries per page configurable through visitor.

so added variable controller:

pagesize: number = 10; // defaults 10

moreover created item component (is own component of mine)

<form-item name="pagesize" [(value)]="pagesize" (change)="table.recalculate()"></form-item>  <ngx-datatable   #table ... 

which creates a

<input type="text" name="pagesize" [ngmodel]="value"> 

now, not work intended. initial value sets 10. when change it, onchange callback has mysterious delay?!. not react same every time. table.recalculate() gets fired correctly, if switch next page, additional data gets appended table instead of replacing data previous page.

can me, missing?

it should ngmodelchange instead of change

<form-item name="pagesize" [value]="pagesize" (ngmodelchange)="table.recalculate()"></form-item> 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -