var ownDataTable = $(".own_cases_table").dataTable();
$.ajax({
url : "api/v1/cases/"+encodeURIComponent(uid)+"/active",
type : "get",
headers : { "Authorization" : api_key },
dataType : "json",
success : function(response) {
if (response.error) {
} else {
var cases = response.cases;
ownDataTable.fnClearTable();
for (var i = 0; i < cases.length; i++) {
console.log(cases[i].case_name);
ownDataTable.fnAddData([ cases[i].case_name, cases[i].slide_img, 'Daha Fazla', 'action' ]);
}
}
}
});
HTML :
<!-- TABLE FOR MOBILE START -->
<table class="table mb30 own_cases_table">
<thead>
<tr>
<th><?php echo _("Olgu"); ?></th>
<th><?php echo _("Dijital Slide"); ?></th>
<th><?php echo _("Daha Fazla"); ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<!-- TABLE FOR MOBILE END -->
<div class="table-responsive hidden-xs hidden-sm">
<table class="table own_cases_table">
<thead>
<tr>
<th><?php echo _("Olgu"); ?></th>
<th><?php echo _("Dijital Slide"); ?></th>
<th><?php echo _("Daha Fazla"); ?></th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
i am using datatables but no data is added in datatables. Always writes "No data avaliable in table"
i checked cases has data and i $(".own_cases_table").DataTable();
but nothing changed.
How i can add data into my tables ?
I tried with ownDataTable.row.add() but same result occured