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?
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 += '
Request # | '; $html += 'Defendant name | '; $html += 'Company Name | '; $html += ''; $html += ' | Action | '; $html += '|
---|---|---|---|---|---|
'+value.Id+' | '; $html += ''+value.DefendantName+' | '; $html += ''+value.SenderCompanyName+' | '; if(value.Read == 0) { $html += 'New | '; } else { $html += 'Read | '; } $html += ''; $html += 'View Detail'; $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 += '
';
$('#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!