views:

51

answers:

2

When I load my page in first place there nothing in the table and the datatable is not initializated, after a few interactions rows are added and when all rows are added (with ajax calls) I init the datatable this way:

oTable = $('#table).dataTable( {
            "bJQueryUI": true,
            "bSortClasses": false,
            "sDom":'T<"clear">',
            "sPaginationType": "full_numbers",
            "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>'
        } );

The problem is I want to be able to clear that table and keep on adding stuff in the html and then reInit the table from that source code without using fnAddData.

Any ideas?

Thank you!

+1  A: 

Can you use fnUpdate and fnClearTable? http://datatables.net/api

Aaron Harun
I didnt quite understand how fnUpdate worked. fnClearTable, however, I dontw ant to clear it, i want to be able to init it again without getting the alert message.
Pierluc
A: 

use the initialization variable bDestory. Not nDestroy.

Gutzofter