2013-05-13 22 views
0

我使用的jqGrid 4.4.5的jqGrid凍結的列顯示不正確的結構

我有網格配置是這樣的:

$(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,那抹,Divisi, Jam,Tarif,Total,Lain - Lain,Insentif,Total,Potongan Lain - Lain,Total「。 當我在colModel id「rovertime_div」處將凍結選項設置爲false時,列結構顯示正確。否則,當我將凍結選項設置爲true時,列結構顯示不正確。

這裏是一個picture預期結果如何。

UPDATE 1:如果我設置useColSpanStyle:false爲列結構顯示正確。

+2

究竟什麼是你的問題? – dreamweiver 2013-05-13 11:25:22

+0

我期望的結果欄是「NIK,Nama,Divisi,Jam,Tarif,Total,Lain - Lain,Insentif,Total,Potongan Lain - Lain,Total」。 – zenixgrace 2013-05-13 15:56:44

+0

如果你已經找到你的問題的答案,那麼我認爲你應該通過自我回答關閉這個問題 – dreamweiver 2013-05-14 05:53:29

回答

0

只需在您的jqgrid sortable: true,中設置排序選項即可。

這裏是運行example

編碼愉快:)

+0

是的,這是我想要的。這是我在jqgrid中發現的錯誤之一。我會向論壇報告。非常感謝您的幫助。 – zenixgrace 2013-05-15 01:39:29

+0

@zenixgrace:好的,我發現很多人都在不同論壇上報道過它的錯誤。你可以試試在jqgrid官方網站上發帖。 – dreamweiver 2013-05-16 13:43:52

+0

:我已向官方網站報告。 – zenixgrace 2013-05-17 18:53:26