Здравейте, иползвам "DataTables" плугин на Jquery,
проблема ми е следният свързах го с базата дани и извеждам резултатите, но когато искам да селектирам и редактирам някой ред ефекта ми е е нулев
ето го кода
Това е файла от който извеждам резултатите
проблема ми е следният свързах го с базата дани и извеждам резултатите, но когато искам да селектирам и редактирам някой ред ефекта ми е е нулев
ето го кода
Код:
<style type="text/css">
@import "media/css/demo_table_jui.css";
@import "media/themes/smoothness/jquery-ui-1.8.4.custom.css";
</style>
<style>
*{
font-family: arial;
}
</style>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})
// Ot tuk zapochva testa
var oTable;
$(document).ready(function() {
/* Add a click handler to the rows - this could be used as a callback */
$("#datatables tbody tr").click( function( e ) {
if ( $(this).hasClass('row_selected') ) {
$(this).removeClass('row_selected');
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
/* Add a click handler for the delete row */
$('#delete').click( function() {
var anSelected = fnGetSelected( oTable );
if ( anSelected.length !== 0 ) {
oTable.fnDeleteRow( anSelected[0] );
}
} );
/* Init the table */
oTable = $('#datatables').dataTable( );
} );
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tr.row_selected');
}
</script>
Това е файла от който извеждам резултатите
Код:
<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("programa", $con);
mysql_query("SET CHARACTER SET utf8");
$result = mysql_query("SELECT * FROM spisak_omsan");
?>
<table id="datatables" class="display">
<thead>
<tr>
<th>Влекач</th>
<th>Ремарке</th>
<th>Шофьор Европа</th>
<th>Шофьор Турция</th>
<th>Тръгване</th>
<th>Прибиране</th>
<th>Дестинация</th>
<th>Фирма</th>
<th>СЕМТ</th>
<th>Забележка</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysql_fetch_array($result)) {
?>
<tr>
<td><?=$row['kamion']?></td>
<td><?=$row['vlekach']?></td>
<td><?=$row['shofior_evropa']?> <br/> <?=$row['shofior_evropa2']?></td>
<td><?=$row['shofior_turcia']?> <br/> <?=$row['shofior_turcia2']?></td>
<td><?=$row['data_trugvane']?></td>
<td><?=$row['data_pribirane']?></td>
<td><?=$row['destination']?></td>
<td><?=$row['firma']?></td>
<td><?=$row['cemt']?></td>
<td><?=$row['zabelejka']?></td>
</tr>
<?php
}
?>
</tbody>
</table>