数据表中的列冻结或固定列 [英] Column Freeze or Fixed Column in datatable

查看:42
本文介绍了数据表中的列冻结或固定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以冻结 Primefaces 数据表的前 3 列?

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

我使用的是 Primefaces 3.1

I'm using Primefaces 3.1

推荐答案

Primefaces 目前不支持固定列.

Primefaces does not support fixed columns right now.

Jquery 固定列被用来实现相同的.参考:http://datatables.net/extras/fixedcolumns/

Jquery fixed column was used to achieve the same. Reference : http://datatables.net/extras/fixedcolumns/

示例:

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
                });

谢谢,什哈

这篇关于数据表中的列冻结或固定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆