“Uncaught TypeError: Cannot use 'in' operator to search for 'length' in ” triggered by Datatables plugin and jQuery 1.11.3

后端 未结 8 1159
北恋
北恋 2021-02-12 13:17

I\'m using the jQuery Datatables plugin to enable pagination, sorting and searching with my tables. The elements are showing up but not working, and the pagination only sometime

8条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-12 13:38

    No need to downgrade jQuery. I solved the same error by using aoColumns as

    $('#id').DataTable( {
        data: [["A", "B"], ["a", "b"]],
        'aoColumns': [ 
            { sWidth: "50%", bSearchable: false, bSortable: false }, 
            { sWidth: "50%", bSearchable: false, bSortable: false }
            ],
        } );
    

    I am using jQuery 2.1.4 and DataTables 1.10.9

提交回复
热议问题