jqgrid冻结列出现不正确的结构 [英] Jqgrid frozen column appear incorrect structure

查看:161
本文介绍了jqgrid冻结列出现不正确的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jqgrid 4.4.5

I'm use 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,总计,Lain-Lain,Insentif,Total,Potongan Lain-Lain,Total". 当我在colModel id"rovertime_div"将Frozen选项设置为false时,列结构正确显示.否则,当我将Frozen选项设置为true时,列结构将显示为错误.

The result column structure what I expected is "NIK,Nama,Divisi,Jam,Tarif,Total,Lain - Lain,Insentif,Total,Potongan Lain - Lain, Total". When I set the frozen option to false at the colModel id "rovertime_div", the column structure appears correctly. Otherwise, when I set the frozen option to true, the column structure appears incorrect.

这是图片预期的效果.

更新1 :如果我设置了useColSpanStyle:false,则列结构正确显示.

UPDATE 1 : If I set useColSpanStyle: false to column structure appears correctly.

推荐答案

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

Just set sortable option in your jqgrid sortable: true,.

这是正在运行的示例

快乐编码:)

这篇关于jqgrid冻结列出现不正确的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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