resize the jqgrid width while browser resizing

2019-06-24 06:49发布

问题:

Hi i have a problem in my jqgrid when i am clicking the pane the grid size is not resizing .how to resize it ?.

回答1:

Not sure if this is what you mean, but this should keep your grid at 100% width:

$(window).bind('resize', function() {
    $("#jqgrid").setGridWidth($(window).width());
}).trigger('resize');


回答2:

The above answer was good, but this solves both problems. Resizing now and Resizing when the window or IFrame gets resized.

        // Size me now...
        $("#list1").setGridWidth($(window).width());

        // Size me later...
        $(window).bind('resize', function () {
            $("#list1").setGridWidth($(window).width());
        }).trigger('resize');

Happy coding!



标签: onresize