【问题标题】:How to select few columns by default in jQuery Bootgrid如何在 jQuery Bootgrid 中默认选择几列
【发布时间】:2019-09-25 05:39:14
【问题描述】:

我正在尝试使用http://www.jquery-bootgrid.com/examples#data-api

当从 SQL 数据库加载表时,所有列都显示为所有复选框都在下拉菜单中标记(附图),我希望只有选定的列默认显示,用户可以在中标记 realted 列字段复选框使其可见。

.Image here

<table id="employee_grid" class="table table-condensed table-hover table-striped" width="70%" cellspacing="0" data-toggle="bootgrid">
            <thead>
                <tr>
                    <th data-column-id="id" data-type="numeric" data-identifier="true">id</th>
                    <th data-column-id="own_referrer">O_Refferer</th>
                    <th data-column-id="own_aact_status">own_aact_status</th>
                    <th data-column-id="rate">rate</th>
                    <th data-column-id="text_Details">text_Details</th>
                    <th data-column-id="remarks">remarks</th>

                    <th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>
                </tr>
            </thead>
</table>

【问题讨论】:

  • 我正在使用此代码jquery-bootgrid.com/examples#data-api 请按“启动此示例按钮”网格将可见
  • 在你的问题中写下你的代码,这样会更清楚。我收回投票。我写这个只是为了帮助你更清楚。

标签: jquery-bootgrid


【解决方案1】:

找到了解决方案。只需将( data-visible="false" )(不带括号)添加到表中的相应行。

<table id="employee_grid" class="table table-condensed table-hover table-striped" width="70%" cellspacing="0" data-toggle="bootgrid">
    <thead>
        <tr> 
           <th data-column-id="own_referrer" data-visible="false">O_Refferer</th> 
           <th data-column-id="own_referrer">O_Refferer</th>
           <th data-column-id="own_aact_status">own_aact_status</th>
           <th data-column-id="rate">rate</th>
           <th data-column-id="text_Details">text_Details</th>
           <th data-column-id="remarks">remarks</th>
           <th data-column-id="commands" data-formatter="commands" data-sortable="false">Commands</th>
        </tr>
    </thead>
</table>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-08
    • 1970-01-01
    • 1970-01-01
    • 2021-06-14
    • 1970-01-01
    • 1970-01-01
    • 2020-08-08
    • 1970-01-01
    相关资源
    最近更新 更多