fnAddData fails with 'TypeError: a is null'
fnAddData fails with 'TypeError: a is null'
Hello.
I'm using DataTables 1.9.4 with jQuery 2.0.3
I'm trying to add a row to the table using
oTable.fnAddData(['aa','bb','cc','dd']);
but when I add a row I get an error from firebug
'TypeError: a is null'
I tried entering an object with data... array.. anything that I try to add produces this error.
how can I properly had data to the table ?
I'm using DataTables 1.9.4 with jQuery 2.0.3
I'm trying to add a row to the table using
oTable.fnAddData(['aa','bb','cc','dd']);
but when I add a row I get an error from firebug
'TypeError: a is null'
I tried entering an object with data... array.. anything that I try to add produces this error.
how can I properly had data to the table ?
This discussion has been closed.
Replies
here you can see that on initialize of the page i have the following:
[code]
oTable=$('#drinksTable').dataTable({
'bJQueryUI': true,
"sPaginationType": "full_numbers",
});
[/code]
and below that I have
[code]
oTable.fnAddData(['aa','b','c','d']);
[/code]
I tried the same with adding an object:
[code]
var tableJsonString = '[{"drink_flavor_type_name":"dfdsdfs","drink_brand_name":"sdfsdsfsdf","global_image_id":null,"drink_ingredients":"fds","is_transparent":"0","liquid_color_type_name":"dfsdfsdfd","alcohol_by_volume":"3343"},{"drink_flavor_type_name":"dfs","drink_brand_name":"sdf","global_image_id":null,"drink_ingredients":"dfsf","is_transparent":"0","liquid_color_type_name":"dfsdf","alcohol_by_volume":"34"},{"drink_flavor_type_name":"fdfs","drink_brand_name":"sdfsf","global_image_id":null,"drink_ingredients":"sdfs","is_transparent":"0","liquid_color_type_name":"sdsf","alcohol_by_volume":"32"},{"drink_flavor_type_name":"sdfs","drink_brand_name":"sdfsdf","global_image_id":null,"drink_ingredients":"dfds","is_transparent":"0","liquid_color_type_name":"dsdf","alcohol_by_volume":"34"},{"drink_flavor_type_name":"sdfds","drink_brand_name":"sdefs","global_image_id":null,"drink_ingredients":"dsfdf","is_transparent":"0","liquid_color_type_name":"fdsfs","alcohol_by_volume":"34"}]';
var tableObj = JSON.parse(tableJsonString);
oTable.fnAddData(tableObj);
[/code]
but i got the exact same results.
what am i missing ?
means to add a thead line with tr and th to specify how many columns i have. I thought that this is done automatically when entering first line with ob ject (columnname=>columnvalue), but instead i'm adding data as arrays to the already defined columns.
Allan