Jqgrid - window.bind event does not allow column resizing in IE8

后端 未结 1 474
无人共我
无人共我 2021-01-07 17:17

For Jqgrid in IE8, column resizing is not working when I bind a resize event to the window. When I click on a column to resize, it shows resize sign but does not do anything

1条回答
  •  太阳男子
    2021-01-07 17:59

    The reason of the problem which you describes is compatibility mode of Internet Explorer. By the way I used to use XHTML 1.0 instead of HTML5 only to make easy to switch off the compatibility mode of IE. Inserting of the line

    
    

    will solve the problem of resizing. Compare your original demo with the fixed one.

    I recommend you additionally fix some other small problems from the demo which you posted (probably the same problems exist in my original demo which you used as prototype). For example one should fix the URL of multiselect and so on. The modified version of the demo you will find here.

    UPDATED: You are right that IE8 (not IE9 where I tested before) still have a problem (another problem) after adding to the . First of all the problem which you describes are fixed in jqGrid 4.4.3 (see the demo). To fix the problem in jqGrid 4.4.1 you have to modify the code for resizing to the following

    $(window).bind("resize", function () {
        var oldWidth = grid.jqGrid("getGridParam", "width"),
            newWidth = $(window).width() - 20;
    
        if (oldWidth !== newWidth) {
            grid.jqGrid("setGridWidth", newWidth);
        }
    }).trigger("resize");
    

    See the corresponding demo.

    0 讨论(0)
提交回复
热议问题