亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

jquery datatable 使用表單編輯表行數據

jquery datatable 使用表單編輯表行數據

慕工程0101907 2021-06-28 08:59:16
var tb = $('#example').DataTable();$('#addRow').on('click', function() {  var typeName = $("#type option:selected").val();  var amount = $("#amount").val();  tb.row.add([typeName, amount]).draw();});<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script><script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script><label>Type</label><select id="type">  <option> Type 01</option>  <option> Type 02</option></select><label>Amount</label><input type="text" id="amount" /><button id="addRow"> Add </button><table id="example" class="display" cellspacing="0" width="100%">  <thead>    <tr>      <th>Type</th>      <th>Amount</th>    </tr>  </thead></table>我需要為每一行附加編輯和刪除按鈕。單擊編輯按鈕時,行數據應加載到下拉列表和文本框。你能指導我這樣做嗎?
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 345 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號