Non aggiungere questa riga ai dati dipslayed.
aggiungere il codice al tuo fnDrawCallback
per aggiungere una riga nel vostro thead
, o all'inizio del vostro tbody
:
var opts = {};
opts.fnDrawCallback = function(){
var mySpecialRow = '<tr><td>First</td><td>Second</td></tr>';
$('#mytable thead').append(mySpecialRow);
// or
$('#mytable tbody').prepend(mySpecialRow);
}
$('#mytable').dataTable(opts);
forse ho perso alcuni dettagli:
var $tr = $('#mytable tr.no-sort');
var mySpecialRow = $tr.html();
$tr.remove();
var opts = {};
opts.fnDrawCallback = function(){
$('#mytable thead').append(mySpecialRow);
// or
$('#mytable tbody').prepend(mySpecialRow);
};
// add any other option you want
opts.sPaginationType = "full_numbers";
$('#mytable').dataTable(opts);
Grazie per la fornitura di un buon esempio, ma ogni volta che sto facendo questa operazione non sta prendendo altre opzioni come ho bisogno di usare "sPaginationType": opzione "full_numbers" che non funziona – NARENDRA
puoi aggiungere qualsiasi opzione ti piace all'oggetto 'opts' – LeGEC
Grazie mille. – NARENDRA