2
このコードのどこかに隠れたデザインを編集するにはどうすればよいですか?現在、これは機能している検索があり、テキストボックスの横に[追加]ボタンを追加したいと思います。しかし、私は下に示しているこのコードで検索を見つけることさえできません。私はこのdatatableテンプレートのブートストラップをyoutubeで見つけました。ブートストラップテンプレートのデザインを編集するには?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Survey Settings</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href=" //maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.datatables.net/1.10.13/css/dataTables.bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php
require_once("/dao/CategoryDAO.php");
require_once("/dao/TopicDAO.php");
$category = new CategoryDAO();
$topic = new TopicDAO();
$allCategories_arr = $category->getAllCategories();
$allTopics_arr = $topic->getAllTopicTitles();
?>
<div class="container">
<div class="row">
<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<tr>
<td>Category ID</td>
<td>Category Name</td>
<td >Action</td>
</tr>
</thead>
<tbody>
<?php
foreach($allCategories_arr as $ar) {
echo "<tr>";
echo "<td>" . $ar['category_id'] . "</td>";
echo "<td>" . $ar['categoryname'] . "</td>";
echo "<td><a class='btn btn-default' href='viewsubcategory.php?catid=" . $ar['category_id'] . "' >More Info</a>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
});
</script>
</body>
私は、このコードは、全体のデザインをトリガーすることを発見しました。したがって、私はこのスクリプトに「隠れた」コードを表示することができますか?私はちょうど追加ボタンと検索の隣にテキストボックスをpudしたい。
<script type="text/javascript">
$(document).ready(function() {
$('#example').DataTable();
});
</script>
ので、基本的には 'search'機能があり、あなたはそれの横にあるボタンを追加したいですか?まあ、あなたはあなたのjsのinteresing部分 - それは['DataTable'](https://datatables.net/)を実現しましたか? –
あなたがデータテーブルを使用しているので、私はあなたがツールバーの検索ボックスについて話しているテキストボックスを前提としています。ツールバーに追加するにはこれをチェックしてくださいhttps://datatables.net/examples/advanced_init/dom_toolbar.html –
ええ、テーブルの上にデータを追加するには、AddボタンとAddboxを追加したいだけです。私はこの先進的なデザインに精通していないので、私はそれで遊ぶのが非常に難しいです – ranger