Pour toute personne qui a ce problème - Primfaces scrollable continue d'avoir des problèmes. Je suis sur 5.1 et ça ne marche pas.
Il suffit d'utiliser une datatable normale et ensuite utiliser CSS3 pour obtenir le défilement au travail:
https://jsfiddle.net/xuvsncr2/170/
Bien sûr, ne pas utiliser la table, thead, tr etc. pour des éléments de ciblage. A la place, utilisez les classes css pour obtenir la bonne date. La partie délicate est que pour définir la taille du volet de défilement, vous devez cibler la div entourant directement la table. Vous pouvez voir comment je l'ai fait ci-dessous
Heres plus sur le FlexBox CSS3: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Heres un exemple de css j'ai utilisé pour primefaces. J'ai juste enveloppé mon datatable avec un <div class="myCompanyScrollable thirtyEM">
.thirtyEM .ui-datatable-tablewrapper{
height: 30em;
}
.myCompanyScrollable table {
display: flex;
flex-flow: column;
height: 100%;
width: 100%;
}
.myCompanyScrollable table thead {
/* head takes the height it requires,
and it's not scaled when table is resized */
flex: 0 0 auto;
width: calc(100% - 1.05em);
display: table;
table-layout: fixed;
}
.myCompanyScrollable table tbody {
/* body takes all the remaining available space */
flex: 1 1 auto;
display: block;
overflow-y: scroll;
}
.myCompanyScrollable table tbody tr {
width: 100%;
}
.myCompanyScrollable table tbody tr {
display: table;
width: 100%;
table-layout: fixed;
}
/* decorations */
.myCompanyScrollable {
border: 1px solid black;
padding: 0.3em;
}
.myCompanyScrollable table {
border: 1px solid lightgrey;
}
.myCompanyScrollable table td, .myCompanyScrollable table th {
padding: 0.3em;
border: 1px solid lightgrey;
}
.myCompanyScrollable table th {
border: 1px solid grey;
}
quelle version de premier plan vous utilisez. – sathish
@sathish version 3.5 –