2010-11-19 16 views

Antwort

0

Nun, es hängt davon ab, was Sie es brauchen für ... wenn Sie nur Spalten versteckt haben wollen, sie dann zu einem späteren Zeitpunkt enthüllen, dann würden Sie diese um die Spalte zu wechseln tun (von der docs)

function fnShowHide(iCol) 
{ 
    /* Get the DataTables object again - this is not a recreation, just a get of the object */ 
    var oTable = $('#example').dataTable(); 

    var bVis = oTable.fnSettings().aoColumns[iCol].bVisible; 
    oTable.fnSetColumnVis(iCol, bVis ? false : true); 
} 

Das Plugin verfügt nicht über eine Schnittstelle (soweit mir bekannt) für das Hinzufügen von Spalten, sondern ganz normale jQuery scheint den Trick zu tun:

$('#example thead tr,#example tfoot tr').append('<th>New title</th>'); 
$('#example tbody tr').append('<td />'); 
Verwandte Themen