【问题标题】:Jqgrid frozen column appear incorrect structurejqgrid冻结列出现结构不正确
【发布时间】:2013-05-13 11:23:43
【问题描述】:

我正在使用 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”处将 freeze 选项设置为 false 时,列结构正确显示。否则,当我将 freeze 选项设置为 true 时,列结构显示不正确。

这是picture 的预期结果。

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

【问题讨论】:

  • 你的问题到底是什么?
  • 我期望的结果列是“NIK,Nama,Divisi,Jam,Tarif,Total,Lain - Lain,Insentif,Total,Potongan Lain - Lain, Total”。
  • 如果你找到了问题的答案,那么我认为你应该通过自我回答来结束这个问题
  • 我还没有找到答案。我只是描述问题的来源。你试过使用我的网格配置代码吗?
  • 所以你的意思是说列名被错误地与你提到的比较?

标签: jquery jqgrid


【解决方案1】:

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

这是正在运行的example

编码愉快:)

【讨论】:

  • 是的,这就是我想要的。这是我在 jqgrid 中发现的错误之一。我会向论坛报告的。非常感谢您的帮助。
  • @zenixgrace:嗯,我发现很多人在不同的论坛上报告它为错误。你可以尝试在jqgrid官方网站上发布。
猜你喜欢
  • 2015-02-21
  • 2011-06-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-01
  • 1970-01-01
  • 2016-12-30
相关资源
最近更新 更多