JQuery datatables: how to delete a row

I want to remove a row from datatable. Here is the code of the code used:

var aSelected = [];

oTable = $('.itemPublished').dataTable({
    "bJQueryUI": true,
    "sPaginationType": "full_numbers",
    "bServerSide": true,
    "bProcessing": true,
    "sAjaxSource": "/item/datatable",
    "bDeferRender": true,
    "iDisplayLength":20,
    "aLengthMenu": [[10, 20, 50, 75, 100, 150], [10, 20, 50, 75, 100, 150]],
    "aoColumnDefs": [
            { "bSortable": false, "aTargets": [ 2, 3, 4 ] },
            { "sClass": "left", "aTargets": [ 1 ] }
    ],
    "fnRowCallback": function( nRow, aData, iDisplayIndex ) {
        if ( jQuery.inArray(aData.DT_RowId, aSelected) !== -1 ) {
            $(nRow).addClass('row_selected');
        }
        $(nRow).addClass('gradeA');
        return nRow;
    }
});

I wanted to test the event to remove a row from datatable. The event is triggered using a button that is located outside the DOM data table. I tried to do this:

$('.test').live('click', function () {
    oTable.fnDeleteRow( 0 ); 
});

To check if it can remove the first row from the table, but it does not and does not cause any errors. Where am I mistaken?

+5
source share
1 answer

The following comment was given here: http://datatables.net/forums/discussion/6208/hyperlink-event-to-delete-row/p1 :

" , fnDeleteRow , Ajax , , fnDraw , ."

+7

All Articles