Stop-stop or fixed column in datatable

Is it possible to freeze the first 3 columns of the Primefaces data table?

I am using Primfaces 3.1

+5
source share
2 answers

Top Prides do not support fixed columns right now.

To achieve this, a fixed jQuery column was used. Link: 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

+9
source

For those who use Primefaces 4.1 or higher, this function is now implemented (it took, by the way, four years from the first request):

https://code.google.com/p/primefaces/issues/detail?id=366

You can play with him in a showcase .

+2
source

All Articles