DataTables: Cannot read property 'length' of undefined

前端 未结 11 1234
醉酒成梦
醉酒成梦 2020-12-13 05:15

I understand this a popular issue, and I have read all the similar questions here on Stack Overflow and other sites (including the datatables website).

To clarify, I

11条回答
  •  渐次进展
    2020-12-13 06:05

    It's even simpler: just use dataSrc:'' option in the ajax defintion so dataTable knows to expect an array instead of an object:

        $('#pos-table2').DataTable({
                      processing: true,
                      serverSide: true,
                      ajax:{url:"pos.json",dataSrc:""}
                }
        );
    

    See ajax options

提交回复
热议问题