Jqgrid冻结列出现错误结构

时间:2013-05-13 11:23:44

标签: jquery jqgrid

我正在使用jqgrid 4.4.5

我有这样的网格配置:

$(document).ready(function () {
    $('#listROvertime')
        .jqGrid({           
            //url: 'http://localhost/bison/rovertime/listing',
            datatype: 'json',
            mtype: 'post',
            colNames: ["NIK","Nama","Divisi","Jam","Tarif","Total"],
            colModel: [
                {name:"rovertime_nik",index:"rovertime_nik",width:100,
                    frozen:true,
                    key:true,
                    searchoptions:{
                        sopt:["eq","ne","bw","bn","ew","en","cn","nc"]
                    }
                },
                {name:"rovertime_name",index:"rovertime_name",width:260,
                    frozen:true,
                    searchoptions:{
                        sopt:["eq","ne","bw","bn","ew","en","cn","nc"]
                    }
                },
                {name:"rovertime_div",index:"rovertime_div",width:120,
                    frozen:true,
                    search:false
                },
                {name:"rovertime_ocount",index:"rovertime_ocount",width:70,align:"right",
                    formatter:"currency",
                    formatoptions:{thousandsSeparator:","},
                    search:false,
                    sortable:false
                },
                {name:"rovertime_oprice",index:"rovertime_oprice",width:110,align:"right",
                    formatter:"currency",
                    formatoptions:{thousandsSeparator:","},
                    search:false,
                    sortable:false
                },
                {name:"rovertime_over",index:"rovertime_over",width:110,align:"right",
                    formatter:"currency",
                    formatoptions:{thousandsSeparator:","},
                    search:false,
                    sortable:false
                }
            ],
            autowidth: true,            
            caption: 'Laporan Lembur'
        }).jqGrid('setGroupHeaders', {
            useColSpanStyle: true,
            groupHeaders: [
                {startColumnName: 'rovertime_ocount', numberOfColumns: 3, titleText: '<center>Lembur</center>'}
            ]
        }).jqGrid('setFrozenColumns');
});

我期望的结果列结构是“NIK,Nama,Divisi,Jam,Tarif,Total,Lain - Lain,Insentif,Total,Potongan Lain - Lain,Total”。 当我在colModel id“rovertime_div”处将冻结选项设置为false时,列结构将正确显示。否则,当我将冻结选项设置为true时,列结构显示不正确。

这是预期结果的picture

UPDATE 1 :如果我将useColSpanStyle:false设置为列结构正确显示。

1 个答案:

答案 0 :(得分:0)

只需在jqgrid sortable: true,中设置可排序选项。

这是正在运行的example

快乐编码:)