javascript - 在 bootgrid 中禁用 'hide' 功能

标签 javascript jquery-bootgrid

我是 bootgrid 和 jquery 或 ajax 的新手。我找到了一个做 table(bootgrid) 的好插件,但我仍然无法理解里面的一些代码。
现在我想在顶部和右侧的下拉菜单中编辑一些东西,下拉菜单将显示 th 值,当您单击该值时,该值的整行将被隐藏。
我只想使其中一个值变为禁用状态。我不想让用户隐藏“命令",因为它排显示按钮。 代码在这里形成:Bootgrid

I want to make the "commands" to disabled

最佳答案

非常简单。假设您有代表您的 bootgrid 的 HTML:

<table id="grid-basic" class="table table-hover table-striped">
    <thead>
        <tr>
            <th data-column-id="ticket-id" data-type="numeric" data-identifier="true">TICKET ID</th>
            <th data-column-id="submission-date">SUBMISSION DATE</th>
            <th data-column-id="status">STATUS</th>
            <th data-column-id="ownership">OWNERSHIP</th>
            <th data-column-id="applicant-name">APPLICANT NAME</th>
            <th data-column-id="applicant-ic">APPLICANT IC</th>
            <th data-column-id="order-type">ORDER TYPE</th>
            <th data-column-id="package">PACKAGE</th>
            <th data-column-id="commands" data-formatter="commands">Commands</th>
        </tr>
    </thead>
    <tbody>
      <!-- data via javascript -->
    </tbody>
</table>

您只需将 data-visible-in-selection="false" 添加到您不想在该下拉菜单中显示的列:

<th data-column-id="commands" data-visible-in-selection="false" data-formatter="commands">Commands</th>

关于javascript - 在 bootgrid 中禁用 'hide' 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43972909/

相关文章:

jquery - 自定义行颜色 Jquery Bootgrid

javascript - 如何定期更改我网站的背景颜色

javascript - 如何在标准/ native JavaScript 函数中设置断点?

javascript - 停止无限 Javascript 循环

javascript - 逐行从文本区域获取文本?

asp.net - 在 ckEditor 中单击保存会触发什么事件?

jquery - Bootgrid 求和列并在页脚中显示结果

JQuery.BootGrid 数据类型和数据格式化程序

jQuery bootgrid 插件——设置列宽