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

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

如何在數據行中添加按鈕

如何在數據行中添加按鈕

慕絲7291255 2023-02-22 19:05:37
如何在相同位置添加按鈕,但在右側(下圖)。我的按鈕和我想把它放在哪里我正在使用燒瓶(python)和 js。我自己找不到解決方案。我在 json 中獲取數據。html代碼表:!-- Build datatable --><div class="row-90">    <table class="table display" id="calEvents">        <thead>            <tr>                <th scope="col">ID</th>                <th scope="col">GROUP</th>                <th scope="col">WEEKDAY</th>                <th scope="col">DATE</th>                <th scope="col">TICKER</th>                <th scope="col">EVENT</th>                <th scope="col">READX</th>                <th scope="col">ACTION </th>            </tr>                  </thead>    </table>和java腳本。    $('#calEvents').DataTable( {    "processing": true,    "serverSide": false,    "order": [[ 3, "asc" ]],    "ajax": "/api/v1/calendar/get",    'columnDefs': [        {           targets: 2, render: function(data1){ return moment(data1).format('dddd')},        },         { targets: 3, render: function(data2){ return moment(data2).format('YYYY-MM-DD')}},    ] } );
查看完整描述

1 回答

?
慕村225694

TA貢獻1880條經驗 獲得超4個贊

我發現解決方案使用目標:-1,然后在數據表中最后添加按鈕。我的代碼

 targets: -1, defaultContent: '<button name="edit" class="btn btn-secondary" type="button">Edit</button>'
                 + '&nbsp <button name="delete" class="btn btn-danger" type="button">Delete</button>'



查看完整回答
反對 回復 2023-02-22
  • 1 回答
  • 0 關注
  • 158 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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