I'm am new in jQuery, so sorry if my question is too simple.
I am trying to do something like this:
$("#send-one").html('done. ');
var tableProgress= $("<table id='table-progress'><tr><td></td></tr></table>");
$("#send-one").empty().append(tableProgress);
tableProgress.dataTable({
    "bPaginate": false,
    "bLengthChange": false,
    "bFilter": true,
    "bSort": false,
    "bInfo": false,
    "bAutoWidth": false
});
All this occurs inside jQuery ui Dialog Box.
It does not work, I think it's because .dataTable() pluggin can't find the table so I am trying to use jQuery $.when.
The error is this
Uncaught TypeError: Cannot read property 'asSorting' of undefined
What I need is: use .datatable pluggin in a table that is inserted in $("#send-one").html('done. ' + tableProgress) but, using .datatable() directly may not be synchronous to the insertion.
I also tried:
$("#send-one").html('done. ' + tableProgress);
$('#table-progress').dataTable();
                This other stack overflow question had a much clearer answer, that it must have a <thead> and a <tbody> to work:
Jquery datatable integration error?
Your's is missing both.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With