0
Я использую DataTables с CodeIgniter после this tutorial.Тип Ошибка: 1 не определен в jQuery.DataTables.min.js
В то время как я загрузке мой взгляд, я получаю сообщение об ошибке в консоли как:
Type Error: 1 is undefined in jquery.dataTables.min.js 49:323
кода мой контроллер является:
public function index()
{
if($this->session->userdata('logged_in'))
{
$this->load->library('table');
$tmpl = array('table_open' => '<table id="doc_table"">');
$this->table->set_template($tmpl);
$this->table->set_heading('TMT_PK_Key', 'Name');
$this->load->view('doctor');
}
else
{
redirect('home');
}
}
function getDocData()
{
$this->load->library('Datatables');
$this->datatables
->select('TMT_PK_Key, Name')
->from('Doctor_Basic');
//->join('Doctor_Email', 'Doctor_Basic.TMT_PK_key = Doctor_Email.TMT_PK_key')
//->select('Email')
//->join('Doctor_Mobile', 'Doctor_Basic.TMT_PK_key = Doctor_Mobile.TMT_PK_key')
//->select('Mobile');
echo $this->datatables->generate();
}
}
Мой вид кода (некоторый код опущен как Js вызова) :
<html>
<body>
<?php echo $this->table->generate(); ?>
</body>
</html>
JS
jQuery(document).ready(function() {
var oTable = jQuery('#doc_table').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '/ci/doctor/getDocData',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayStart ": 100,
"oLanguage": {
"sProcessing": "<img src='/ci/images/loading.gif'>"
},
'fnServerData': function (sSource, aoData, fnCallback) {
jQuery.ajax
({
'dataType': 'json',
'type': 'POSt',
'url': sSource,
'data': aoData,
'success': fnCallback
});
},
});
});
Данные возвращаемые (инспектировать элемент => Сеть => Response):
draw:0
recordsTotal:1331
recordsFiltered:1331
data:Array
0:Object
TMT_PK_Key:"TMTPK"
Name:"ABC"
Я пытался смотреть в форумах, но не смог найти решение. Любая помощь будет высоко оценена.