DataTables警告:表id =扩展名-无法重新初始化DataTable。有关此错误的更多信息,请参见http://datatables.net/tn/3

时间:2018-12-22 11:05:43

标签: ajax codeigniter-3

  

DataTables警告:表id = user-无法重新初始化DataTable。对于   有关此错误的更多信息,请参见   http://datatables.net/tn/3

  <table id="user" class="table datatable-responsive-row-control">
                    <thead>
                        <tr>
                            <th>Username</th>
                            <th>Account</th>
                            <th>data CID</th>
                            <th>Type</th>
                        <?php if(!$this->session->userdata('type') == '0') { ?>
                            <th>Action</th>
                         <?php } ?>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>

$(document).ready(function(){         $('#user')。DataTable({

        "processing": true,
        "serverSide": true,
        "ajax":{
            "url": "<?php echo base_url('user/use_data') ?>",
            "dataType": "json",
            "type": "POST",
        },
        "columns": [
            { "data": "name" },
            { "data": "accountid" },
            { "data": "dataid" },
            { "data": "type" },
        <?php if(!$this->session->userdata('type') == '0') { ?>
            { "data": "actions" },
        <?php } ?>
        ]
    });    
});    

0 个答案:

没有答案