0

I use PrimeNG (version 7.0.4) p-table and besides configuring row numbers via [rows] parameter in HTML, I want to set minimum rows for p-table.

For example, I set [rows]=10 and there are only 5 records at the last page. I want to display 10 rows even if there is only one record in the p-table. I look at How to set minimum value of rows primeNG datatable, but I am wondering if there is a configuration for that.

Antikhippe
  • 6,316
  • 2
  • 28
  • 43
Jack
  • 1
  • 21
  • 118
  • 236

1 Answers1

0

This approach works like a charm:

if (this.records.length < 10) {
    let temp = { "Id": '', "Name": '', "Surname": '', "Age": '' };
    for (let i = this.records.length; i < 10; i++) {
        this.records.push(temp);
    }
}

Thanks @Antikhippe :)

Jack
  • 1
  • 21
  • 118
  • 236