I'm using data table but facing some problems
I'm using data table but facing some problems
this is my html
<
div class="panel-body ">
Id | Event Name | College Name | Start Date | End Date | Approval | Visibility |
---|
my js
html += '<tr>'
+ '<td>'+data.details[i].id+'</td>'
+ '<td>'+data.details[i].name+'</td>'
+ '<td>'+data.details[i].college+'</td>'
+ '<td>'+data.details[i].startDate+'</td>'
+ '<td>'+data.details[i].endDate+'</td>'
+ '<td><button class="btn btn-info btn-xs detailButton" data-toggle="tooltip" data-placement="top" data-original-title="Click to See Particular Event Details"><i class="fa fa-pencil"></i></button>'
+ '<button class="btn btn-danger btn-xs deleteButton" data-toggle="tooltip" data-placement="top" data-original-title="Click to Delete Event"><i class="fa fa-trash-o"></i></button></td>';
if(data.details[i].approval == 1)
html += '<td><i class="fa fa-check"></i><td>';
else
html += '<td><i class="fa fa-close"></i><td>';
// + '<td>'+data.details[i].approval+'</td>'
html += '<td>'+data.details[i].visibility+'</td>'
+ '</tr>'
}
// $('#searchResults tbody').find("tr").remove();
$('#searchResults tbody').find('.generated').remove();
$('#searchResults tbody').append(html);
// $('[data-toggle="tooltip"]').tooltip();
$('#searchResults').DataTable();
$('.detailButton').on('click', function(){
var elem = $(this).parents('tr');
var festId = elem.find('td:eq(0)').text();
window.location = 'festEvents.php?festId=' + festId;
})
Answers
I'm getting mdata undefined
...