jquery - 显示已选中数据复选框的 Bootstrap 表

标签 jquery html css twitter-bootstrap bootstrap-table

如何显示已选中 data-checkbox 的 Bootstrap 表?

<div class="fixed-table-body">
    <div class="fixed-table-loading" style="top: 41px; display: none;">Chargement des données...</div>
    <table id="GetSpiAttached"
           data-toggle="table"
           data-url=@Url.Action("GetUser","User")
           data-side-pagination="server"
           data-pagination-next-text="›"
           data-pagination-pre-text="‹"
           data-toolbar="#toolbar">
        <thead>
        <tr>
            <th data-field="Id" data-sortable="true">Code Client</th>
            <th data-field="Nom" data-sortable="true">Nom</th>
            <th data-field="Prenom" data-sortable="true">Prénom</th>
            <th data-field="TitreCivilite" data-sortable="true">Civilité</th>
            <th data-checkbox="true"></th>
        </tr>
        </thead>
    </table>
</div>

enter image description here

最佳答案

下面的示例显示了使用 checked

选中的复选框

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Form control: inline checkbox</h2>
  <p>The form below contains three inline checkboxes:</p>
  <form>
    <label class="checkbox-inline">
      <input type="checkbox" value="" checked>Option 1
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" value="" checked>Option 2
    </label>
    <label class="checkbox-inline">
      <input type="checkbox" value="" checked>Option 3
    </label>
  </form>
</div>

</body>
</html>

关于jquery - 显示已选中数据复选框的 Bootstrap 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41740417/

相关文章:

html - 使链接图像相对于背景图像中心

jquery - 为什么 CSS 动画会有延迟?

javascript - 在 IE 中加载和解析 XML

javascript - 离开页面前获取url

html - 如何在使用覆盖时保留 img 链接功能?

php - 如何动态更改 CSS

javascript - 自动刷新 <div> 文本

javascript - 在 flex-box 中使用 javascript 管理图像

javascript - 防止多次点击按钮

css - 带有文本框背景图像的 Firefox 表单中的超大光标