ng2-table icon indicating copy to clipboard operation
ng2-table copied to clipboard

ItemsPerPage cannot be changed dynamically

Open MeindertRomkes opened this issue 9 years ago • 2 comments

Hi all,

I have a question about changing the amount of items per page, because I have some problems with it. But what is the best solution to change the amount manually with an input dropdown. At the moment I made a EventEmitter and have a function that changes the var itemPerPage, It worked for the first per page, but when I navigate (with the pagination) the amount it's not right.

What I found out is that the amount of items at the last page is correct, but when I navigate one page in the opposite direction(and further) the amount of items shown is (total of pages - current page) * itemPerPage.

I hope someone can help me out, Kind Regards

MeindertRomkes avatar Aug 26 '16 10:08 MeindertRomkes

when you assign value of itemPerPage. Than make sure that you called onTableChange Function. Because at time of value changed in the variable it will not re-render the html. whenever you changed the any of variable or item related to table you need to re-render the html. for this onTableChanged(this.config) I hope this will work you. It's been working for me.

Hasnain-Bukhari avatar Jan 17 '17 06:01 Hasnain-Bukhari

as mentioned above i assigned value to itemPerPage from input dropdown and called onChangeTable function ,but navigating to next pages gave strange result with me .. i was missing casting string value from dropdown into integer ,fianally solved ...

BibekGautam avatar Sep 04 '17 09:09 BibekGautam