Column Freeze or Fixed Column in datatable

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

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

I'm using Primefaces 3.1

回答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



回答2:

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.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!