Tôi đang sử dụng bootstrap để vẽ một bảng và tôi cần cả chức năng tìm kiếm và bộ lọc. Nhưng chức năng tìm kiếm không thể hoạt động sau khi tôi thêm chức năng lọc. khi tôi xóa hàng "", chức năng tìm kiếm hoạt động, nhưng chức năng lọc biến mất, cách sử dụng cả hai chức năng? Đây là mã:Bảng khởi động sử dụng tìm kiếm và bộ lọc như thế nào?
<div id="filter-bar"></div>
<table id="tbl" data-height="299" data-show-toggle="true" data-show-columns="true" data-show-export="true" data-select-item-name="toolbar1">
<thead>
<tr>
<th data-field="id" data-align="right" data-sortable="true">Item ID</th>
<th data-field="name" data-align="center" data-sortable="true">Item Name</th>
<th data-field="price" data-align="" data-sortable="true">Item Price</th>
</tr>
</thead>
</table>
<link rel="stylesheet" href="/static/libs/bootstrap3/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/libs/bootstrap3/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/static/libs/bootstrap-table-master/src/bootstrap-table.css">
<link rel="stylesheet" href="/static/libs/jasny-bootstrap/css/jasny-bootstrap.min.css">
<link rel="stylesheet" href="/static/libs/bootstrap-table-master/src/extensions/filter/bootstrap-table-filter.css">
<script type="text/javascript" src="/static/libs/jquery2/jquery-2.0.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/bootstrap-table.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/filter/bootstrap-table-filter1.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/filter/bootstrap-table-filter.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/filter/bs-table.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/export/bootstrap-table-export.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/export/tableExport.js"></script>
<script type="text/javascript" src="/static/libs/bootstrap-table-master/src/extensions/export/jquery.base64.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#tbl").bootstrapTable({
url: "tbl_data.json",
method: "get",
showFilter: true,
search: true,
queryParams: function (p) {
return{
device: 'iphone',
mdate: '2014-12-13',
};
}
});
});
404 Lỗi trong liên kết – atiruz
liên kết Cập nhật đến tập tin: https://github.com/wenzhixin/bootstrap-table/blob/develop/src/extensions/filter/bootstrap- table-filter.js – brettex