Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82823

DataTables cannot recognize data from DOM

$
0
0
Hi.

I have this simple table :

<table id="logsTable" style="width:100%;text-align:center;">
<thead>
<th style="width:9%;">Choose</th>
<th style="width:15%;">Ip</th>
<th style="width:15%;">Hostname</th>
<th style="width:50%;">Log</th>
<th style="width:15%;">Date</th>
</thead>
<tbody id="logData"></tbody>
</table>

The tbody fills with function loadLogsTable(); that returns 30 table rows

function loadLogsTable()
{
jQuery.ajax({
type: "POST",
async : true,
url: "classes/classesController.php",
data: { method: "getLogsList"},
contentType : ('application/x-www-form-urlencoded'),
dataType : "html" ,
success : function(data){
$("#logData").html(data);
}   
});
}

I initialize this table with dataTables but it doesn't paginate them and it looks like it cannot see table's data. I cannot also search in table's data.

$(document).ready(function()
{	
loadLogsTable(); 
			
$('#logsTable').dataTable({  // Init pagination
"aoColumnDefs": [{ "bSortable": false, "aTargets": [ 0,1,2,3,4] } ],
"sPaginationType": "full_numbers" ,
"bLengthChange": false,
iDisplayLength": 10
});
});

Any advice?

Viewing all articles
Browse latest Browse all 82823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>