【问题标题】:How to increase jqgrid header checkbox size如何增加 jqgrid 标题复选框的大小
【发布时间】:2016-02-26 04:12:15
【问题描述】:

使用来自JQgrid set row height 答案的样式增加了免费 jqgrid 行高和字体大小 和How to make free jqrid font awesome action buttons bigger

/* https://stackoverflow.com/questions/3203402/jqgrid-set-row-height
*/
.ui-jqgrid .ui-jqgrid-htable th {
    height: 2em;
    font-size: 1.2em;
}

.ui-jqgrid tr.jqgrow td {
    height: 2.8em;
}


/*https://stackoverflow.com/questions/28972025/how-to-make-free-jqrid-font-awesome-action-buttons-bigger/
*/
.jqgrow .ui-jqgrid-actions > .ui-pg-div > span {
    font-size: 22px;
}

使用了 FontAwesome 图标集和复选框。 网格列标题中的行选择列复选框仍然太小:

如何使行选择列标题复选框与行中的大小相同?

更新

我创造了风格

#grid_cb {
    padding: 0;
}

#jqgh_grid_cb {
    margin: 0;
    height: 21px;
}

#cb_grid {
    width: 100%;
    height: 100%;
}

但这适用于具有 id 网格的网格。如何使其也适用于其他网格?

【问题讨论】:

    标签: jquery css checkbox jqgrid free-jqgrid


    【解决方案1】:

    人们可以通过不同的方式实现需求。例如,可以执行以下操作

    $("#list_cb").css({padding: 0});
    $("#jqgh_list_cb").css({margin: 0, height:"21px"});
    $("#cb_list").css({width: "100%", height: "100%"});
    

    如果网格的 id 是"list"。结果会得到如下图所示的标题:

    在不同的网络浏览器中,结果可能会略有不同(因为在某些浏览器中使用了小的阴影效果,所以总是以 1px 为单位)。见the demo

    更新:与CSS规则相同的设置如下:

    .ui-jqgrid .ui-jqgrid-htable th.jqgh_cbox {
        padding: 0;
    }
    .ui-jqgrid .ui-jqgrid-htable .ui-jqgrid-labels .jqgh_cbox > div {
        margin: 0;
        height: 21px;
    }
    .ui-jqgrid .ui-jqgrid-labels .jqgh_cbox > div > .cbox {
        width: 100%;
        height: 100%;
    }
    

    the demo

    如果您要使用来自 GitHub 的最新免费 jqGrid 资源,则可以将上述 CSS 规则简化为以下内容:

    .ui-jqgrid .ui-jqgrid-htable .ui-jqgrid-labels .jqgh_cbox > div {
        height: 21px;
    }
    .ui-jqgrid .ui-jqgrid-labels .jqgh_cbox > div > .cbox {
        width: 100%;
        height: 100%;
    }
    

    【讨论】:

    • 谢谢。如何将其添加到 css 文件中,以便它也适用于 ID 为其他列表的网格?我更新了问题。
    • @Andrus:不客气!我也更新了我的答案。请参阅更新部分。
    • 我用来自 github 的 jqgrid 试过这个。每行开头的选择复选框小于标题中增加的复选框,如答案中的图像所示。如何增加行首的 checkbx 大小,使其与增加的标题复选框具有相同的大小?
    • @Andrus:对不起,但我不能更新更多的 4000 旧答案以使用最新的免费 jqGrid 版本。旧答案显示可以使用哪些 CSS 规则(.ui-jqgrid .ui-jqgrid-htable .ui-jqgrid-labels .jqgh_cbox > div.ui-jqgrid .ui-jqgrid-labels .jqgh_cbox > div > .cbox),您应该将旧演示中的 CSS 设置与新设置进行比较,以确定您需要另外覆盖的更改以获得您想要的外观.
    • @Andrus:如果您有问题,您应该发布新问题,前提是您对问题的描述足够清楚。您的意思是哪个演示(答案包含两个演示),您使用哪个 iconSetguiStyle,您包含哪些 CSS(仅 jQuery UI,仅 Bootstrap CSS 或两者)以及哪些版本等等。您应该包括展示您想要消除的更改的图片。顺便说一下,guiStyle: "bootstrap" 显示的所有复选框和许多其他组件都像以前一样大。
    猜你喜欢
    • 2017-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-08
    • 1970-01-01
    • 2012-01-04
    相关资源
    最近更新 更多