Jak dodać klasę do wiersza, który dodaję do datatable?Jak dodać klasę do nowego wiersza w datowables jquery?
Jeśli nie jest możliwe, jak mogę zmienić klasę za pomocą fnRowCallback
lub fnDrawCallback
?
oTable = $('#example').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>',
"fnRowCallback": function(nRow, aData, iDisplayIndex) {
var oSettings = oTable.fnSettings();
oSettings.aoData[iDisplayIndex].nTr.className = "gradeX odd";
}
});
Powyższy kod daje błąd.
to w jaki sposób mogę dodać wiersz:
oTable.fnAddData(arr);
wątpię, to naprawdę pomaga, ale zrobić. Próbowałem wielu innych rzeczy, ale bez rezultatów. – Pierluc
lub czy istnieje sposób, aby po prostu dodać wiersz html, do datatable za pomocą funkcji datatables – Pierluc