/* ------------------------------------------------------------------------------ * * # Invoice archive * * Specific JS code additions for invoice_archive.html page * * Version: 1.0 * Latest update: Aug 1, 2015 * * ---------------------------------------------------------------------------- */ $(function() { // Table setup // ------------------------------ // Initialize $('.invoice-archive').DataTable({ autoWidth: false, columnDefs: [ { width: '30px', targets: 0 }, { visible: false, targets: 1 }, { orderable: false, width: '100px', targets: 7 }, { width: '15%', targets: [4, 5] }, { width: '15%', targets: 6 }, { width: '15%', targets: 3 } ], order: [[ 0, 'desc' ]], dom: '<"datatable-header"fl><"datatable-scroll-lg"t><"datatable-footer"ip>', language: { search: 'Filter: _INPUT_', lengthMenu: 'Show: _MENU_', paginate: { 'first': 'First', 'last': 'Last', 'next': '→', 'previous': '←' } }, lengthMenu: [ 25, 50, 75, 100 ], displayLength: 25, drawCallback: function ( settings ) { var api = this.api(); var rows = api.rows( {page:'current'} ).nodes(); var last=null; api.column(1, {page:'current'} ).data().each( function ( group, i ) { if ( last !== group ) { $(rows).eq( i ).before( '