Angular Material Table set default number of rows

拟墨画扇 提交于 2019-12-26 03:09:08

问题


I want to set a number of rows on the table on page load having no data yet. If I click a button for me to display the list of data it will then populate the rows for n number I set.

I already tried adding a default length on the matrow.

Let say ngOnInit() it will display 8 rows and when I click a button to display the data, it would fill up the 8 rows I set and there's still a pagination using mat-paginator.

Is this possible?


回答1:


Populate using empty data according to the number of initial rows, then load real data when the button is clicked.

Stackblitz: https://stackblitz.com/edit/angular-f3g5vu?file=app%2Ftable-pagination-example.ts



来源:https://stackoverflow.com/questions/56988286/angular-material-table-set-default-number-of-rows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!