Thursday, May 07, 2015

Some effect with datatables

.highlight{
    background-color: rgba(255, 200, 50, 0.1) !important;
}
tbody tr:hover {
    background-color: rgba(255, 200, 50, 0.1) !important; 
}







$(document).ready(function() {
    var lastIdx = null;
    var table = $('table').DataTable();
    $('table tbody')
            .on( 'mouseover', 'td', function () {
                var colIdx = table.cell(this).index().column;

                if ( colIdx !== lastIdx ) {
                    $( table.cells().nodes() ).removeClass( 'highlight' );
                    $( table.column( colIdx ).nodes() ).addClass( 'highlight' );
                }
            } )
            .on( 'mouseleave', function () {
                $( table.cells().nodes() ).removeClass( 'highlight' );
            } );
} );


No comments:

Post a Comment

xfce4-screenshooter keyboard shortcut

sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...