【问题标题】:Bootstrap table .js remove event not working引导表 .js 删除事件不起作用
【发布时间】:2022-08-10 16:44:51
【问题描述】:

我正在尝试使用引导表删除行。

桌子:

<table id=\"checkDataTable\">
    <thead style=\"color: #31708f; background-color: #d9edf7 \">
        <tr>
            <th data-field=\"AssetReference\">Referans</th>
            <th data-field=\"Customer\">Müşteri</th>
            <th data-field=\"ReceiverCompanyName\">Alıcı Firma</th>
            <th data-field=\"Tools\" data-formatter=\"StatuFormatter\" >İşlem</th>
        </tr>
    </thead>
</table>
 

状态格式化程序:

function StatuFormatter(value, row, index) 
{
    return \"<a  onclick=\'removeAssetEconomyCheckBillOfLadingRow(\"+index+\")\'><i class=\'fa fa-trash fa-2x\' aria-hidden=\'true\'></i></a>\";
}

removeAssetEconomyCheckBillOfLadingRow 函数:

function removeAssetEconomyCheckBillOfLadingRow(index) 
{
    alert(index);
    $(\'#checkDataTable\').bootstrapTable(\'remove\', {field: \'$index\',values: index});
}

我可以在alert 框中获取索引值。但是无法删除行。

    标签: javascript jquery bootstrap-table


    【解决方案1】:

    问题出在values: index 它可能对您有帮助:https://stackoverflow.com/a/64258424/11143288

    【讨论】:

    • 不幸的是不是问题的解决方案
    猜你喜欢
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多