DataTables警告:table id = big_table – 第0行请求的未知参数“0”。

在此处输入图像描述

我正在使用jquery datatables插件和codeigniter,同时尝试跟随(大致) http://www.ahmed-samy.com/php-codeigniter-full-featrued-jquery-datatables-part-1/ 。 我收到以下错误:

DataTables warning: table id=big_table - Requested unknown parameter '0' for row 0. For more information about this error, please see http://datatables.net/tn/4 

在firebug中没有错误,并返回以下JSON:

 {"draw":0,"recordsTotal":3,"recordsFiltered":3,"data":[{"id":"2","message_id":"","subject":"Delivery Status Notification (Failure)","date":"2014-07-02 19:34:17"},{"id":"3","message_id":"","subject":"Flying the red, white and blue on YouTube","date":"2014-07-03 19:01:21"},{"id":"4","message_id":"","subject":"Delivery Status Notification (Failure)","date":"2014-07-04 22:34:16" 

我注意到即使记录数(3)是正确的,抽奖也是0。 表本身就是空的。

我怎样才能解决这个问题?

我的控制器:

function index(){

  //set table id in table open tag $tmpl = array('table_open' => ''); $this->table->set_template($tmpl); $this->table->set_heading("id,message_id,subject,date"); $this->load->view('serversidetestview'); } //function to handle callbacks function datatable() { $this->datatables->select("id,message_id,subject,date")->from('imap'); echo $this->datatables->generate(); }

我的看法:

   <base href="">         

Subscriber management

table->generate(); ?> $(document).ready(function () { var oTable = $('#big_table').dataTable({ "bProcessing": true, "bServerSide": true, "sAjaxSource": 'datatable_controller/datatable', "bJQueryUI": true, "sPaginationType": "full_numbers", "iDisplayStart ": 20, "fnInitComplete": function () { oTable.fnAdjustColumnSizing(); }, 'fnServerData': function (sSource, aoData, fnCallback) { $.ajax ({ 'dataType': 'json', 'type': 'POST', 'url': sSource, 'data': aoData, 'success': fnCallback }); } }); });

将Datatables.php从示例代码库( http://www.ahmed-samy.com/demos/sources/tutorial_datatables.zip )复制到库目录中,而不是直接下载。 我认为最新下载可能存在错误。 我有完全相同的问题。