Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35273

adding rows to a table

$
0
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?


Viewing all articles
Browse latest Browse all 35273

Trending Articles