我有这个简单的(我猜)DataTable初始化,但是我收到以下错误:
TypeError:无效' in'操作数obj http://localhost/WB/jquery.js第539行
这是我的代码:
var table = $('#dt_table').DataTable({
"processing": true,
"pageLength": 100,
"bSortCellsTop": true,
"order": [[0, "asc"]],
"dom": '<"top"pfl>rt<"bottom"lp><"clear">',
"search": "Search:",
"zeroRecords": "No match",
"columnDefs": [ { "targets": [1,2,3,4], "orderable": false } ]
});
表格的HTML
<table class="table table-striped table-hover" id="sconti">
<thead>
<tr>
<th>Codice Sconto</th>
<th>Descrizione</th>
<th>% Sconto</th>
<th>% Sconto extra</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class='sconto'>
<td class="text-center"><a class="editable editable-click" data-name="codice_sconto" data-pk="0">0</a></td>
<td><a class="editable editable-click editable-empty" data-name="descrizione_sconto" data-value="" data-pk="0">Empty</a></td>
<td class="text-center"><a class="editable editable-click " data-name="p_sconto" data-pk="0">0</a></td>
<td class="text-center"><a class="editable editable-click " data-name="p_sconto_extra" data-pk="0">0</a></td>
<td class="text-center"><a class='delete_row' data-pk="0"><i class='fa fa-times red-intense'></i></a></td>
</tr>
</tbody>
</table>
我已经在SO上搜索了解决方案,但是我找不到任何解决方案,因为我既没有$ .each()循环,也没有错误的数组/对象(就像其他建议的解决方案一样)。那么,我做错了什么?
在jquery.js的第539行我有函数isArraylike,通过添加一个console.log(obj)我可以看到&#39; obj&#39;变量是一个空字符串..