Я использую bootstrap-table и пытаюсь установить флажки, проблема заключается в том, что флажки инициируются как отмеченные без особой причины
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.0.js"></script>
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
<script type="text/javascript" src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
<title>Bootstrap Table</title>
</head>
<body>
<div class="container">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">why checked?</div>
<div class="panel-body">
<table data-row-style="rowStyle" data-toggle="table" data-click-to-select="true">
<thead>
<th data-field="dd" data-checkbox="true">
</th>
<th data-sortable="true">
x
</th>
<th data-sortable="true">
y
</th>
<th data-sortable="true">
z
</th>
<th data-sortable="true">
t
</th>
<th data-sortable="true">
r
</th>
<th data-sortable="true">
m
</th>
<th></th>
</thead>
<tbody>
<tr>
<td>
</td>
<td> 1</td>
<td>2</td>
<td>3</td>
<td> 4</td>
<td> 5</td>
<td><span class="label label-default">xxx</span></td>
<td>
<div class="form-inline text-right">
<form class="form-group" action="{{url('invobj')}}/{{$obj->id}}/edit" method="post">
<button class="btn btn-primary btn-xs"><i class="glyphicon glyphicon-pencil"></i></button>
</form>
<form class="form-group" action="{{url('invobj')}}/{{$obj->id}}" method="post">
<input name="_method" type="hidden" value="DELETE">
<input type="hidden" name="_token" value="{{csrf_token()}}">
<button class="btn btn-warning btn-xs"><i class="glyphicon glyphicon-remove"></i></button>
</form>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
демонстрация: http://jsfiddle.net/e3nk137y/12160/
Второй вопрос, как добавить имя и значение в флажки, я пытался вернуть значение/пользовательский атрибут из функции data-formatter
, но не видел никаких изменений в инструменте разработчика
В документации не упоминается какой-либо атрибут/функция/событие для настройки флажков дома.
Обновить кажется, что если вы хотите отсортировать выбранные элементы, первый столбец (столбец флажка) исчезнет