2011-05-10 98 views
2

Hai, 我面對IE瀏覽器中的對齊問題。
場景:
1.化妝組列作爲隱藏(groupColumnShow:[FALSE])
2.化妝任何列隱藏,(隱藏:真)附
屏幕快照。 enter image description herejqgrid隱藏分組列 - 對齊問題IE瀏覽器

[截圖] http://uatdemo.sify.net:4080/jqgrid.png

請幫忙解決。

jQuery("#list48").jqGrid({ 
    data: mydata, 
    datatype: "local", 
    height: 'auto', 
    rowNum: 30, 
    rowList: [10,20,30], 
    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], 
    colModel:[ 
     {name:'id',index:'id', width:60, sorttype:"int"}, 
     {name:'invdate',index:'invdate', width:90, sorttype:"date", 
      formatter:"date"}, 
     {name:'name',index:'name', width:100, editable:true}, 
     {name:'amount',index:'amount', width:80, align:"right",sorttype:"float", 
      formatter:"number", editable:true}, 
     {name:'tax',index:'tax', width:80, align:"right",sorttype:"float", 
      editable:true},   
     {name:'total',index:'total', width:80,align:"right",sorttype:"float"},  
     {name:'note',index:'note', width:150, sortable:false}  
    ], 
    pager: "#plist48", 
    viewrecords: true, 
    sortname: 'name', 
    grouping:true, 
    groupingView : { 
     groupField : ['name'], 
     groupColumnShow : [false] 
    }, 
    caption: "Hide Grouping Column" 
}); 
+0

請設置一個包含測試數據(HTML),您正在使用的CSS和腳本 – ariel 2011-05-10 07:10:21

回答

1

我無法重現您描述的問題。您可以將您的代碼與the demo進行比較,並嘗試查找您的錯誤。

1

我有完全相同的問題。我找到了解決辦法是如下:

  1. 將所有隱藏字段末(在colModel)
  2. 定義這個功能:

    function resolveAlignmentJqgridBug() { 
        /* 
        Without the below line, the "jqgfirstrow" has child <TD> for every hidden column. 
        These <TD>s have non zero width and with "display: none". 
        Setting the style of these <TD>s to "width: '0px', display: 'block'" resolves the problem. */ 
        jQuery(".jqgfirstrow").find(":hidden").css({width: '0px', display: 'block'}); 
    } 
    
  3. 呼叫電網的定義和每一個後此功能當我更改分組時(我有動態分組更改):

    jQuery("#list").jqGrid({ 
    ... 
    datatype: "json", 
        colNames:['not hidden field','hidden field'], 
        colModel:[ 
        ... 
        {name:'typeId', hidden:false}, 
         {name:'url', hidden:true} 
        ], 
        autowidth: true, 
        shrinkToFit:true, 
    ... 
    grouping: true, 
        groupingView : { 
        groupField : ['statusDesc'], 
        groupColumnShow : [true], 
        groupText : ['<b>{0}</b> ({1})'], 
        groupCollapse : false, 
        groupOrder: ['asc'], 
        groupSummary : [false], 
        groupDataSorted : false 
        }, 
    ... 
    }); 
    
    resolveAlignmentJqgridBug(); 
    } 
    
+0

的http://jsFiddle.net,但它會留下空白: – Chester 2014-02-12 12:19:28

1

此錯誤可以通過在HTML代碼頂部添加指令來解決:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+0

也許你應該詳細說明這一點,因爲你的建議似乎有些奇怪。 – Gumbo 2011-10-12 17:09:15

0

試試這個:

jQuery("#list48").jqGrid('hideCol', "yourColumnName"); 
0

剛上載完成的jqGrid事件的末

電話
loadComplete: function() { 
    jQuery(".jqgfirstrow").find(":hidden").css("cssText", "width:0px!important;height:0px!important;display:none!important");   
}