I'm following the jquery datatables tutorial for adding child tables to display after a click.
var table = $("#equipment_table").dataTable(
{
"paging": false,
"ordering": false,
"info": false
});
$('#equipment_table tbody').on('click', 'td .pickup_button', function(){
alert("clickee");
var tr = $(this).closest('tr');
var row = table.row(tr);
if(row.child.isShown()){
//open , close it
row.child.hide();
tr.removeClass('shown');
}else {
row.child( buildChild(tr.attr('id'))).show();
tr.addClass('shown');
}
});
and here's the html button definition in php
echo '<td> <button class="delivery_button" id="'.$eid.'"> Delivery Status </button> </td>';
echo '<td> <button class="pickup_button" id="'.$eid.'"> Pickup Status </button> </td>';
echo '</tr>';
}
echo '</tbody>';
after getting the click listener to work, i get this error
Uncaught TypeError: undefined is not a function
on var row = table.row(tr); line
alert()? If it doesn't you should check and post your html instead of the php.tableget set?var row = table.row(tr);buildChildfunction come from?