首页 > 解决方案 > 不更改 tabledit 中的列

问题描述

**现在有两列是可编辑的,但我只想编辑一列,即数量列。但它不起作用。下面的代码有什么问题?带有 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>

标签: jquerytabledit

解决方案


推荐阅读