How to initialize DataTables with data already obtained ajax
How to initialize DataTables with data already obtained ajax
Hello, I have a problem: in general, there is a tab, while clicking on the tab, I get the data ajax and put them in the table, and then want to tie dataTables, and swears that it does not see the data, decided to call $ ( "# myTable"). dataTable (); after receipt of data in the complete (Ajax), thought there take jquery.live, but it is not the type of event will not work, and the type of event where I do not need, how to get to see the data dataTable, and how to check have i instance or not
[code]
$.ajax({
type: POST,
cache: true,
url: host + /includes/functions/bookmarkbody.php,
data: workpage= + selectedTabID,
success: function(msg)
{
$(#myTable).html(msg);
},
complete: function()
{
$(#myTable).dataTable();
}
});
},
selected: -1
});
[/code]
Sorry for my English
[code]
$.ajax({
type: POST,
cache: true,
url: host + /includes/functions/bookmarkbody.php,
data: workpage= + selectedTabID,
success: function(msg)
{
$(#myTable).html(msg);
},
complete: function()
{
$(#myTable).dataTable();
}
});
},
selected: -1
});
[/code]
Sorry for my English
This discussion has been closed.
Replies
??????: nThs is null
????????: http://mypm/public/js/jquery.dataTables.js
??????: 4669
and
??????: sData is undefined
????????: http://mypm/public/js/jquery.dataTables.js
??????: 701
Assuming that #myTable is the tag, I presume that 'msg' is along the lines of "......"? Otherwise you will run into problems. Aside for that, this would work fine. Do you have an example you can link to?
Regards,
Allan