adding rows to a table
adding rows to a table
ufk
Posts: 6Questions: 1Answers: 0
Hello.
I'm using dtatables 1.10.0, and I'm trying to add a row to a table.
i have the following code that defines the table (server side is php):
oTable=$("#generic_drinks_table").dataTable({
"sAjaxSource" : '<?=$this->url('drink-generic',array('action'=>'get-drinks-generic-list-json'))?>',
"aoColumns": [
{ "mData" : "drink_generic_id", "sTitle" : "id" },
{ "mData" : "drink_type_name", "sTitle" : "Drink Type"},
{ "mData" : "drink_flavor_type_name", "sTitle" : "Drink Flavor"}
],
"bProcessing": true,
"aLengthMenu": [[100, 200, 300], [100, 200, 300]],
"iDisplayLength": 100,
"iDisplayStart" : 0,
"sAjaxDataProp" : "",
});
and I have the following code to add a row to that table:
oTable.row.add([data, 'test', 'test']).draw();
but it seems that oTable.row is undefined! any ideas?
This discussion has been closed.
Answers
ahhmm.. it seems that I needed to use .DataTables and not .dataTables. why ? what's the difference?
THANK YOUUUUUUU, I spent about an hour investigating in this. Could anyone please inform us what is the big deal?
.DataTables is the new API in version 1.10
Yup - second FAQ from the top.
See also the API manual.
Regards,
Allan