我在我的網站中使用引導,我從json文件填充我的表,我怎麼能得到所選行的所有數據?雙擊引導表充滿了json
這裏是我的代碼:
<?php
$sql = "select * from choisir where Etudiant_Matricule='".$idEquipe."' order by ordre asc";
$result = mysqli_query($conn, $sql) or die("Error in Selecting " . mysqli_error($conn));
while($row =mysqli_fetch_assoc($result)) {
$emparray3[] = $row;
}
$json_data = json_encode($emparray3);
file_put_contents('tables/fichedevoeux.json', $json_data); ?>
<table data-toggle="table" data-url="tables/fichedevoeux.json" data-show-refresh="true" data-show-toggle="true" data-show-columns="true" data-search="true" data-select-item-name="toolbar1" data-pagination="true" data-sort-name="name" data-sort-order="desc">
<thead>
<tr>
<th data-field="Code" data-sortable="true">Code</th>
<th data-field="Titre" data-sortable="true">Titre</th>
<th data-field="Specialite" data-sortable="true">Spécialité</th>
<th data-field="Technologie" data-sortable="true">Technologie</th>
<th data-field="Outil" data-sortable="true">Outils</th>
<th data-field="Promotion_ID" data-sortable="true">Promotions_ID</th>
<th data-field="Validation" data-sortable="true">Validation</th>
</tr>
</thead>
</table
我已經試過,但它不工作
$('tr').on('dblclick', function() {
alert('row clicked');
});
您能否提供一個表格,其中包含一些已填充的示例數據,以便了解表格的最終結構? –
https://img4.hostingpics.net/pics/180053Sanstitre.png – Aymen