**现在两栏可以编辑,但我只希望数量栏可以编辑。但这不起作用。以下代码有什么问题?带有html代码 ** $(document).ready(function(){
$('#editable_table').Tabledit({
url:'action.php',
columns:{
identifier:[0, "id"],
editable:[ [1, 'tran_quantity'] ]
},
restoreButton:false,
onSuccess:function(data, textStatus, jqXHR)
{
if(data.action == 'delete')
$('#'+data.id).remove();
}
});
});
<table id="editable_table" class="table table-hover table-sm" style="border-radius: 5px; font-size: 12px">
<thead>
<tr>
<th>Decription</th>
<th style="text-align: right">Price</th>
<th style="text-align: center">Quantity</th>
<th style="text-align: right">Amount</th>
</tr>
</thead>
<tbody>
<?php
while($row = mysqli_fetch_array($result))
{
echo '
<tr>
<td>'.$row["tran_description"].'</td>
<td align="right">'.$row["tran_price"].'</td>
<td align="center">'.$row["tran_quantity"].'</td>
<td align="right">'.$row["tran_amount"].'</td>
</tr>
';
}
?>
</tbody>
</table>