1

I am using jqGrid with a large number of columns. I have an issue where some of the columns are cut off in Internet Explorer (I am testing on IE9) All columns are shown fine in Firefox. Can anyone think of a reason or a workaround to this issue. I have put a screenshot below of the last cols in Firefox versus IE. IE does popup with a horizontal scrollbar but this is a pain because i am showing 100s of rows so you have to scroll down a lot in the browser to then scroll to see the last columns. Trying to see if there is anyway to get rid of that grid horizontal scroll bar

Here is Firefox where all 16 columns are shown

enter image description here

Here is Internet Explorer where only 14 full columns are shown and the 15th column (ResourceType) is cut off 1/2 way through the column

enter image description here

Any suggestions on how to get all columns to show up in Internet Explorer

leora
  • 188,729
  • 360
  • 878
  • 1,366
  • This probably wont help you right now, but this has been an issue that has been cropping up with the grid lately as browsers receive updates. Here is a similar posting that related to chrome: http://stackoverflow.com/questions/10588587/jqgrid-does-not-render-correctly-in-chrome-chrome-frame Generally these kind of issues are fixed in the next release of the grid. If you need it fixed now you are most likely looking at source changes. – DisplayName Aug 15 '12 at 11:57
  • Also to help determine if it is a issue with the grid and IE9, or just an issue with your grid, please view the demo site with IE9 and report if the issue happens. http://www.trirand.com/blog/jqgrid/jqgrid.html if it is not you will need to include your grid code so that we may determine the issue. – DisplayName Aug 15 '12 at 12:05
  • @fbfcn - the issue with looking just at this page: http://www.trirand.com/blog/jqgrid/jqgrid.html is there are not any grids that are wide enough to test – leora Aug 15 '12 at 12:25
  • yes I am aware that it is a different issue. Though in that issue they were getting the scroll bar because of the column cutoff. I was just pointing out that this has been happening recently with all of the browsers and jqGrid and relating to how it handles column widths. – DisplayName Aug 15 '12 at 12:31
  • @fbfcn - I deleted my last comment because I do actually see a scroll bar in IE that does allow me to scroll to see the last columns. So its less of an issue that I initially thought but still an issue. I have updated the title and question description to be more explicit – leora Aug 15 '12 at 12:34

2 Answers2

2

I suppose that you have the same problem as I described in the bug report. In the case you should change the last line of the internal cellWidth function from

return testCell !== 5;

to

return Math.abs(testCell – 5) > 0.1;

You can do this in jquery.jqGrid.src.js or just try with the file. It fixed the problem with the wrong calculation of the grid width in my case.

Oleg
  • 220,925
  • 34
  • 403
  • 798
1

I used the Jqgird 4.5.2 and the chrome version is Version 28.0.1500.71. The solution list above is not work in my environment.I donot why,so i try to log the testCell!==5. And it is return false in firefox and false in chrome. Finaly i add return false in the cellwidth not care the compare result. And it works.

cellWidth : function () {
    var $testDiv = $("<div class='ui-jqgrid' style='left:10000px'><table class='ui-jqgrid-btable' style='width:5px;'><tr class='jqgrow'><td style='width:5px;'></td></tr></table></div>"),
    testCell = $testDiv.appendTo("body")
        .find("td")
        .width();
    $testDiv.remove();
    return false;
},

Hope it can helpfully.

chunguiw
  • 831
  • 9
  • 6