adding rows problem

adding rows problem

voippvoipp Posts: 1Questions: 0Answers: 0
edited March 2014 in General
Hello!
I have a dinamic adding of rows and wrapping the table(in order to it to be looked as a datatables table) like this(in the beginning of a script tag):

[code]
$.ajax({
url: "rest/services/TestsServ?templateId=" + $.url().param('id'),
type: "GET",
async: true,
success: function (data) {
$.each(data.aaData, function(index, value){
$("#tests tbody").append('' + value.name.toString() + '' +
'' + value.path.toString() + '');
});
}
});

$("#tests").dataTable({
"bProcessing": false,
"bServerSide": false,
"bPaginate": false,
"bSort": true,
"bStateSave": false,
"bLengthChange": true,
"bFilter": false,
"bInfo": false
});
[/code]

HTML of table is void:

[code]

Тесты


Тест
Путь





[/code]

Somehow datatables wrap the table without wrapping rows i added dinamically(it has wrapped only void table).
So i am very confused about this situation. JQuery append() works like html() function(which adds static html code), so datatables have to wrap it as usual html table, hasnt it ?

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    See the FAQs: http://datatables.net/faqs#append

    Basically, you must use the API.

    Allan
This discussion has been closed.