Javascript boostrap表中的表多重排序不';不能在一页中处理多个表
我使用和扩展。当我在一个页面中有两个表时(在我的例子中,第二个表在模态窗口中),在第二个表中,我没有任何多排序的选择 htmlJavascript boostrap表中的表多重排序不';不能在一页中处理多个表,javascript,jquery,twitter-bootstrap,twitter-bootstrap-3,bootstrap-table,Javascript,Jquery,Twitter Bootstrap,Twitter Bootstrap 3,Bootstrap Table,我使用和扩展。当我在一个页面中有两个表时(在我的例子中,第二个表在模态窗口中),在第二个表中,我没有任何多排序的选择 html <table ref="mainTable" className="table table-striped table-bordered table-hover" cellSpacing="0" id="mainTable" data-show-toggle="true" data-show-columns="true" data-search="true" d
<table ref="mainTable" className="table table-striped table-bordered table-hover" cellSpacing="0" id="mainTable" data-show-toggle="true" data-show-columns="true" data-search="true" data-pagination="true">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="Customer Name" data-halign="center"
data-align="left" data-sortable="true">Customer Name</th>
<th data-field="Location Type" data-halign="center"
data-align="left" data-sortable="true">Location Type</th>
<th data-field="Location" data-halign="center"
data-align="left" data-sortable="true">Location</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Cap Corp</td>
<td>Main</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>Cap Corp</td>
<td>Other</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>Tel</td>
<td>Main</td>
<td>Slough SL1 4DX</td>
</tr>
<tr>
<td></td>
<td>Tel</td>
<td>Other</td>
<td>London W1B 5HQ</td>
</tr>
</tbody>
</table>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover" cellspacing="0" id="modalTable" data-click-to-select="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-pagination="true">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="name">Name</th>
<th data-field="stargazers_count">Stars</th>
<th data-field="forks_count">Forks</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>ala</td>
<td>234</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>ala</td>
<td>234</td>
<td>Norwalk CT 06851</td>
</tr>
<tr>
<td></td>
<td>ala</td>
<td>234</td>
<td>Slough SL1 4DX</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
您的模式表标题缺少
数据sortable=“true”
属性:
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="Customer Name" data-halign="center"
data-align="left" data-sortable="true">Customer Name</th>
<th data-field="Location Type" data-halign="center"
data-align="left" data-sortable="true">Location Type</th>
<th data-field="Location" data-halign="center"
data-align="left" data-sortable="true">Location</th>
</tr>
</thead>
客户名称
位置类型
位置
第二个表中的某个地方有一个文书错误,导致第二个表无法排序。根据你发布的内容。
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="Customer Name" data-halign="center"
data-align="left" data-sortable="true">Customer Name</th>
<th data-field="Location Type" data-halign="center"
data-align="left" data-sortable="true">Location Type</th>
<th data-field="Location" data-halign="center"
data-align="left" data-sortable="true">Location</th>
</tr>
</thead>