在浏览器调整大小时调整 jqgrid 宽度

发布于 2024-08-02 17:17:34 字数 52 浏览 2 评论 0原文

您好,当我单击窗格时,我的 jqgrid 出现问题,网格大小未调整大小。如何调整它的大小?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

温柔戏命师 2024-08-09 17:17:34

不确定这是否是您的意思,但这应该使您的网格保持 100% 宽度:

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

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');
肤浅与狂妄 2024-08-09 17:17:34

上面的答案很好,但这解决了这两个问题。
立即调整大小和在调整窗口或 IFrame 大小时调整大小。

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

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

快乐编码!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文