Cannot display table from json data
Cannot display table from json data
dave_g
Posts: 4Questions: 2Answers: 0
Hi all
I am attempting a really basic display of data, however my page loads and I have no table generated.
My my html code
<div id="storeslist" class="col-md-2">
<table id="delivery-stores" class="display">
</table>
</div>
my javascript
displaystores: function(dateid)
{
$.getJSON(dd.handlerUrl + 'getstores&dateparam=' + dateid, function (json) {
$('#delivery-stores').dataTable({
aaData: json
});
});
},
and finally my debug data
http://debug.datatables.net/abaqen
Can anyone spot what I am missing?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Ah, you have to define the table in HTML first :-)
This is what I ended up with
Glad it worked out for you. I notice that you are using the legacy syntax. If you are new to Datatables it is probably better to use the current syntax.
Thanks, I am working on the new one at the moment, actually finding it quite a bit easier.