1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| $(document).ready(function() {
var oTable = $('#tableau_membres').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 3, "desc" ]], // order by numéro colone, asc / desc
"bStateSave": true, // use cookies in the end user's web-browser, if the user were to reload the page, the table should remain exactly as it was
"aoColumnDefs": [ { "sType": "numeric", "aTargets": [ 3 ] } ],
"aLengthMenu": [[ -1,10,25,50], ["Tous",10,25,50]], // nb éléments à afficher
"oLanguage": { // version Française
"sProcessing": "Veuillez Patientez...",
"sLengthMenu": "Affichage _MENU_ éléments par page",
"sZeroRecords": "Aucun élément trouvé.",
"sInfo": "Affichage _START_ à _END_ sur _TOTAL_ enregistrements",
"sInfoEmpty": "Aucun enregistrement affiché",
"sInfoFiltered": "(filtrés de _MAX_ enregistrements au total)",
"sSearch": "Rechercher:",
"oPaginate": {
"sFirst": "Premier",
"sPrevious": "Préc",
"sNext": "Suiv",
"sLast": "Dernier"
}
}
});
/* Ajoute la class highlighted à une colone*/
oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 9; // % nb colones
$('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
oTable.$('td.highlighted').removeClass('highlighted');
} );
}); |
Partager