如何在 DataTable 中添加一行作为最后一行?未捕获的类型错误:无法读取未定义的属性“添加”

问题描述

<table style="width: 100%;" class="table table-hover table-striped table-bordered" id="example3">
...
</table>    

<script type="text/javascript">
    $(document).ready(function() {
        var table=""; 
        setTimeout(function () {

            table=$('#example3').DataTable({
                responsive: true
            });
            
            },2000);

        table.row.add( {
                "Bill Date": "","Name": "","Amount": 40,"Source": "","Destination": "","Project": "","Comments": "","File": "","Created": "","Action": ""
            } ).draw();
        
    });
</script>

我收到错误:Uncaught TypeError: Cannot read property 'add' of undefined,我该如何解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)