Is it possible to freeze first 3 columns of Primefaces' data table?
I'm using Primefaces 3.1
Is it possible to freeze first 3 columns of Primefaces' data table?
I'm using Primefaces 3.1
Primefaces does not support fixed columns right now.
Jquery fixed column was used to achieve the same. Reference : http://datatables.net/extras/fixedcolumns/
Example:
var oTable2 = $(primfacesDataTableId).find('table').dataTable({ "sScrollX" : "100%", //Scroll "sScrollY" : "180", "bAutoWidth" : false, "bScrollCollapse" : true, "bPaginate" : false, "bSort" : false, "sInfo" : "", "sInfoEmpty" : "" }); var oFC = new FixedColumns(oTable2, { "iLeftColumns" : 4, //Freezed first for columns "sHeightMatch" : "auto", "iLeftWidth" : 405 });
Thanks, Shikha
For those who are using Primefaces 4.1 or above, this feature is now implemented (it took four years from the first request, by the way):
https://code.google.com/p/primefaces/issues/detail?id=366
You can play with it in the showcase.