【问题标题】:jqGrid, checkbox not aligned to left on edit form. BootstrapjqGrid,复选框未在编辑表单上左对齐。引导程序
【发布时间】:2018-04-25 01:01:47
【问题描述】:

我正在使用 jqGrid JS v5.3.0,styleUI 设置为 Bootstrap。在编辑表单上,复选框(通过设置 edittype 选项创建。也设置 editoptions: {value:"true:false"})与表单的中心对齐。有没有办法让它向左对齐?

提前致谢。

【问题讨论】:

    标签: jqgrid


    【解决方案1】:

    原因是bootstrap css中的设置

    .EditTable td input, 
    .EditTable td select, 
    .EditTable td textarea { 
        width: 98%; 
        display: inline-block;
    }
    

    即这是由 width:98% 引起的

    有很多方法可以纠正这个问题。

    第一个是使用editoptions来设置手动自动宽度和样式选项。

    edittype : 'checkbox',
    editoptions : {value:"true:false", "style":"width:auto"},
    

    第二个(更优雅的恕我直言)是在 css 中为编辑表单中的所有复选框设置这个,如下所示:

    <style>
        .EditTable td input[type="checkbox"] 
        {
            width :auto;
        }
    </style>
    

    加载 jqgrid 引导 css 文件后。

    【讨论】:

    • 是的!在 mysite.css 文件中添加了第二个,它可以工作。
    猜你喜欢
    • 2014-12-14
    • 2018-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-26
    • 2014-01-19
    • 1970-01-01
    • 2017-12-14
    相关资源
    最近更新 更多