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

Git get all remote branches

git branch -r \ | grep -v '\->' \ | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" \ | while read remote; do \ git branc...