0

I have set up previous working Datatables with similar code, but for some reason on this other area of my site it refuses to work, and throws TypeError: g[(d + i)][f] is undefined

Code:

<table id="tableSearchResults" class="table table-striped table-hover">
<thead>
 <tr>
  <th>Amenity</th>
  <th>Activity</th>
  <th>Period</th>
  <th>Booked by</th>
  <th>Unit</th>
  <th>Reference</th>
  <th>Status</th>
  <th class="no-sort"></th>
 <tr>
</thead><tbody></tbody></table>


   var dataSet = [["Ballroom", "lalalala", "2/6/2017<br />10:00 AM - 12:30 PM", "Internal booking", "N/A", "", "<a href='#' id='payment43' data-toggle='popover' data-html='true' data-content='<b>Received By</b><br />Robert Benedetto<br />2/6/2017 2:59:24 PM'>PAID</a>", "<a href='amenity_booking.aspx?d=43&bb=0' onclick='return confirm(&quotAre you sure you want to permanently delete this booking?&quot);'><i class='fa fa-trash'></i></a>"], ["Ballroom", "Testing", "8/29/2017<br />9:00 AM - 9:30 AM", "HoangTest TranTest", "<a href='unit_info.aspx?uid=7005'>1S Narra, 1408</a>", "", "<span class='label label-danger'>PENDING</span>", "<a href='amenity_booking.aspx?d=44&bb=1' onclick='return confirm(&quotAre you sure you want to permanently delete this booking?&quot);'><i class='fa fa-trash'></i></a>"]];

    $("#tableSearchResults").DataTable({
        data: dataSet,
        "deferRender": true,
        "lengthMenu": [[50, 100, 150, 200, 250, -1], [50, 100, 150, 200, 250, "All"]],
        "iDisplayLength": 100,
        "order": [],
        "columnDefs": [{ "targets": 'no-sort', "orderable": false }, { "searchable": false, "targets": [2, 6, 7] }]
    });

Can anyone spot anything that is off? I sure can't.

1 Answer 1

2

You didn't close tr element, it should be </tr> not <tr>.

Sign up to request clarification or add additional context in comments.

4 Comments

You are right, thanks, but it doesnt solve it though.
It did solve it. Had removed # from the ID name to experiment, forgot to add it back. Thanks!
your code works well, no idea why you said it did not solve your issue jsfiddle.net/r5p1ovdq
oh man, I wasted my 2 hours on this silly mistake. :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.