Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional Pagination on Datatable

Tags:

primefaces

I need conditional pagination on data-table, that is, need to add pagination only if the number of records is > say 5.

The reason is when the pagination is included in the data table, it occupies the space of a row on screen. In maximum cases, the number of rows would be 5 only. So, the intent is to save the screen space for these majority cases.

like image 644
Shikha Dhawan Avatar asked Dec 02 '22 23:12

Shikha Dhawan


1 Answers

According to primefaces' documentation:

set dataTable paginator like this

 paginator="true" rows="5" paginatorAlwaysVisible="false"

- the paginator will be visible only if there are more than 5 records in the table.

like image 109
leostiw Avatar answered Mar 29 '23 14:03

leostiw