Pf3 custom number of items per page - datatable pagination

hi,
I would like to customize the pagination for a datatable ( provide dynamic list with values for number of elements on a page ) . What do you recommend me : do this from datatable javascript options ( I have tried and it did not work ) or change the selectpicker with pagination options ?
Do you have an example for this ?
thank you