Merge branch 'main' of https://github.com/franknstayn/merchbay_admin into main
This commit is contained in:
@@ -327,7 +327,7 @@ desired effect
|
||||
$.fn.dataTable.ext.search.push(
|
||||
function (settings, data, dataIndex) {
|
||||
|
||||
if (settings.nTable.id !=='tbl_store_orders') {
|
||||
if (settings.nTable.id !=='tbl_store_orders' || settings.nTable.id !=='tbl_order_status') {
|
||||
return true;
|
||||
}
|
||||
var min = $('#min').datepicker("getDate");
|
||||
@@ -342,7 +342,61 @@ desired effect
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
|
||||
var tbl_order_status = $('#tbl_order_status').DataTable({
|
||||
initComplete: function () {
|
||||
this.api().columns(0).every( function () {
|
||||
var column = this;
|
||||
var select = $('<select class="form-control"><option value=""></option></select>')
|
||||
.appendTo( $('#tbl_order_status_filter').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>' )
|
||||
} );
|
||||
} );
|
||||
},
|
||||
autoWidth: false,
|
||||
// scrollX: true,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text: "<i class=\"fa fa-table\"></i> CSV",
|
||||
title : function() {
|
||||
return "ORDER STATUS REPORTS";
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text: "<i class=\"fa fa-file-excel-o\"></i> Excel",
|
||||
title : function() {
|
||||
return "ORDER STATUS REPORTS";
|
||||
}
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 4, type: 'date', visible: false },
|
||||
{ targets: 4, type: 'date' }
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
var table = $('#tbl_store_orders').DataTable({
|
||||
initComplete: function () {
|
||||
@@ -401,6 +455,10 @@ desired effect
|
||||
$("#min").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
|
||||
$("#max").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
|
||||
|
||||
|
||||
$("#min").datepicker({ onSelect: function () { tbl_order_status.draw(); }, changeMonth: true, changeYear: true });
|
||||
$("#max").datepicker({ onSelect: function () { tbl_order_status.draw(); }, changeMonth: true, changeYear: true });
|
||||
|
||||
$(document).on('a click', '.btn-order-item-details', function(e){
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user