After puzzling over this for a few hours, and looking everywhere for help, I now post here. My problem: the jQuery DataTable plugin's $(selector).DataTable()
always returns an empty array.
To create this in minimal form, and using DataTables 1.10.7, applied to the
I find that var tableRef = $("#example").DataTable()
returns []
.
$("#example")
resolves as you would expect to
<table id="example" class="display dataTable" cellspacing="0" width="100%" role="grid" aria-describedby="example_info" style="width: 100%;">…</table>
with
$("#example tr").length // 12 rows
This old-style API works:
$("#browserTable").dataTable();
[<table id="browserTable" cellpadding="0" cellspacing="0" margin-left="0" border="1" class="display dataTable" aria-describedby="browserTable_info" role="grid" style="width: 1339px;">…</table>]
But the new does not.
I am at a loss. What am I doing wrong? Can anyone help?