1
我在數據表中使用Bootstrap實時搜索實時搜索不適用於數據表
實時搜索選擇框僅在第一頁中可見。第一頁後不可見。
我已經下載了所需的JS/CSS文件到我的電腦
<script src='./js/jquery.dataTables.min.js'></script>
<script src='./js/dataTables.bootstrap.min.js'></script>
<script src='./js/bootstrap.min.js'></script>
<script src='./js/bootstrap-select.min.js'></script>
<script>
$(document).ready(function() {
$('.jobreq_list').DataTable();
});
</script>
<link rel='stylesheet' href='./css/bootstrap.min.css' />
<link rel='stylesheet' href='./css/dataTables.bootstrap.min.css' />
<link rel="stylesheet" href="./css/bootstrap-select.min.css" />
HTML
echo"<table class='jobreq_list table table-striped table-bordered'>
<thead><tr><th>S.no</th><th>Supervisor</th><th>JobReq</th><th>Planning Date</th></tr></thead><tbody>";
$sno=0;
foreach($result as $row) {
$supervisor=$row['supervisor'];
$ufirstname=$row['firstname'];
$ulastname=$row['lastname'];
$uid=$row['uid'];
$rat_planning_date=date("Y-m-d",strtotime($row['rat_planning_date']));
$sno++;
echo"<tr><td>$sno</td><td>$supervisor</td><td>$ufirstname</td><td>
<select class='selectpicker' data-show-subtext='true' data-live-search='true'>
<option>Expert PHP</option>
<option>Demo PHP</option>
<option>PHP Tutorials</option>
<option>PHP Framework & PHP Framework PHP FrameworkPHP Framework</option>
<option>PHP Libraries</option>
<option>HTML</option>
<option>CSS</option>
<option>JS</option>
<option>MySQL</option>
</select>
</td></tr>";
}
echo"</tbody></table>";