adding rows problem
adding rows problem
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 ?
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 ?
This discussion has been closed.
Replies
Basically, you must use the API.
Allan