我不断收到此错误警报 =“DataTables 警告(表 id = 'msnc_table'):从第 0 行的数据源请求未知参数 '1'”
这是我的代码片段:
HTML:
<table id="msnc_table" class="dataTable">
<thead>
<tr>
<th>Doc#</th>
<th>Date</th>
<th>Code</th>
<th>Customer Name</th>
<th>S/m</th>
<th>Gross</th>
<th>Disc</th>
<th>Net</th>
<th>S.Disct</th>
<th>Invc</th>
</tr>
</thead>
<tbody>
<tr>
<td class="dataTables_empty">Loading data from server</td>
</tr>
</tbody>
</table>
JS
var msnc_table = $('#msnc_table').dataTable({
"bProcessing": true,
"bServerSide": true,
"iDisplayStart": 0,
"iDisplayLength": 11,
"sAjaxSource": base_url+"raw/raw_ajax/get_mnsc",
"bRetrieve": true
});
PHP 函数
function get_mnsc()
{
echo '{"sEcho":"2","iTotalRecords":20,"iTotalDisplayRecords":20,"aaData": [["232412","12\/8\/2012","DSDA2312","Alfonso supermarket","213","231213","21312","2313","2313","2312432\r\n"],["232412","12\/8\/2012","ADS332","MCL Store","213","231213","21312","2313","2313","2312432\r\n"]]}'
}