jqGrid header width different from data column width

折月煮酒 提交于 2020-01-05 09:05:35

问题


I've implemented jqGrid with treeGrid enabled. On Firefox, the width off the header row (with the titles of the columns) is different from the width off the data rows. I've attached the init code for the jqGrid and a link with the screenshot image off the problem (because I'm new to the site, it appears I can't upload the image)

jQuery("#treegrid").jqGrid({
   treeGrid: true,
   treeGridModel: 'nested',
   ExpandColumn : 'customer',
   url: 'index.php?page=902&uid=' + uid + '&forecast_pageno=' + pageno,
   datatype: "json",
   mtype: "POST",
      colNames:["Id","Type","Customer","Year","%" , "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Total", "Status"],
      colModel:[
         {name:'id',index:'id',hidden:true},
         {name:'type',index:'type',hidden:true},
         {name:'customer',index:'customer', width:225, align:"left", sortable:false, fixed:true},
         {name:'year', index:'year', width:45, sortable:false, align:"right"},
     {
             name:'market_increase',
             index:'market_increase',
             width:30,
             editable:true, editrules:{number:true},
             formatter:marketIncreaseFormatter,
             unformat:marketIncreaseUFormatter, sortable:false, align:"right"
         },
         {name:'jan', index:'jan', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'feb', index:'feb', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'mar', index:'mar', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'apr', index:'apr', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'may', index:'may', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'jun', index:'jun', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'jul', index:'jul', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'aug', index:'aug', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'sep', index:'sep', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'oct', index:'oct', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'nov', index:'nov', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'dec', index:'dec', width:60, editable:true, editrules:{number:true}, sortable:false, align:"right"},
         {name:'total', index:'total', width:60, sortable:false, align:"right"},
         {name:'status', index:'status', hidden:true}

      ],
   height:'auto',
   cellEdit: true,
   rowNum: -1});

Screenshot Image

Thanks, Gabriel


回答1:


Okey, there seems I was using a different css file for the jqGrid, from an older release. An update of the css solved the problem. Thanks, Gabriel



来源:https://stackoverflow.com/questions/3805381/jqgrid-header-width-different-from-data-column-width

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!