carga
carga
This commit is contained in:
53
static/assets/js/init/datatables-init.js
Normal file
53
static/assets/js/init/datatables-init.js
Normal file
@@ -0,0 +1,53 @@
|
||||
(function ($) {
|
||||
// "use strict";
|
||||
|
||||
|
||||
/* Data Table
|
||||
-------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
$('#bootstrap-data-table').DataTable({
|
||||
lengthMenu: [[10, 20, 50, -1], [10, 20, 50, "All"]],
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#bootstrap-data-table-export').DataTable({
|
||||
dom: 'lBfrtip',
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$('#row-select').DataTable( {
|
||||
initComplete: function () {
|
||||
this.api().columns().every( function () {
|
||||
var column = this;
|
||||
var select = $('<select class="form-control"><option value=""></option></select>')
|
||||
.appendTo( $(column.footer()).empty() )
|
||||
.on( 'change', function () {
|
||||
var val = $.fn.dataTable.util.escapeRegex(
|
||||
$(this).val()
|
||||
);
|
||||
|
||||
column
|
||||
.search( val ? '^'+val+'$' : '', true, false )
|
||||
.draw();
|
||||
} );
|
||||
|
||||
column.data().unique().sort().each( function ( d, j ) {
|
||||
select.append( '<option value="'+d+'">'+d+'</option>' )
|
||||
} );
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user