Is it possible to initialize dataTable to a table which rendered in jquery?

Is it possible to initialize dataTable to a table which rendered in jquery?

waheed.imtiazwaheed.imtiaz Posts: 1Questions: 5Answers: 0

Hi everyone,
I searched a lot but not seen any answer about this problem I am calling a php function through ajax here is my code after getting response
incomingTransferBondRequests.processMainBondRequestTableView = function(response) {
var $html = '';
incomingTransferBondRequests.loadBondRequestDetail(response);
if(response.status==1){
incomingTransferBondRequests.request_count=0;
if(typeof response.list_of_requests != 'undefined' && !$.isEmptyObject(response.list_of_requests)) {
incomingTransferBondRequests.request_count += response.list_of_requests.length;
$html += '

'; $html += '
'; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $html += ''; $(response.list_of_requests).each(function(key, value) { $html += ''; $html += ''; $html += ''; $html += ''; if(value.Read == 0) { $html += ''; } else { $html += ''; } $html += ''; $html += ''; }); $html += ''; $html += '
Request #Defendant nameCompany NameAction
'+value.Id+''+value.DefendantName+''+value.SenderCompanyName+' New Read'; $html += 'View Detail'; $html += '
'; $html += '
'; $html += ' Load More'; $html += '
'; $html += '
'; $html += '

';
$('#maindiv').html($html);
if(incomingTransferBondRequests.default_list_size > response.list_of_requests.length) {
$('#load_more').addClass('hidden');
} else {
$('#load_more').removeClass('hidden');
}
} else {
var page_count = parseInt(incomingTransferBondRequests.request_count/20, 10) || 0;
if(page_count) {
showErrorMessage('Sorry! no more records to display');
} else {
$html += '

'; $html += '
'; $html += '
'; $html += '
'; $html += '

';
$('#maindiv').html($html);
showErrorMessage('Sorry! you have not received any request yet');
}
}
}else {
showErrorMessage(response.message);
}
waitingDialog.hide();
};
Now i want to initialize a datatble to this rendered table what i can do for this please help me. Thanks!

This discussion has been closed.