row.add([]) randomly misses data out
row.add([]) randomly misses data out
Hello, i came along to a strange "bug".
I am clearing the table with .clear() and adding, for test purposes, table.row.add([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]);
this for every dataset i have.
After that i do table.draw();
Everything works, no errors occur, but some data is missing.
In my example the 6,13 and 14 are missing. Do i insert one number before 6, it obviously writes 6 in the 7th column. So the data ain't the problem.
$(function () {
$('#customerTable').DataTable({
"columns": [
{"name" : "ID","defaultContent": ""},
{"name" : "State","defaultContent": ""},
{"name" : "Type","defaultContent": ""},
{"name" : "Name","defaultContent": "","type":"html"},
{"name" : "Trial","defaultContent": ""},
{"name" : "Trial End","defaultContent": ""},
{"name" : "Plan","defaultContent": ""},
{"name" : "Sites","defaultContent": ""},
{"name" : "Users","defaultContent": ""},
{"name" : "Interactions","defaultContent": ""},
{"name" : "Total","defaultContent": ""},
{"name" : "Today","defaultContent": ""},
{"name" : "Last Active", "defaultContent": "","type":"date"},
{"name" : "Registered","defaultContent": ""},
{"name" : "Graph","defaultContent": ""},
],
"pageLength": 20,
"lengthMenu": [10, 15, 20, 50, 100]
});
Table gets initialized with this. Usualy i do it without the columns:[] but if i do not define them, i get an /tn/4 error "Object object".
Back to the question, why is some data missing.
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
It appears to work for me: http://live.datatables.net/zixiheyo/1/edit . Can you link to a test page showing the issue please.
Allan