|
Lines 32-40
var dataTablesDefaults = {
Link Here
|
| 32 |
} |
32 |
} |
| 33 |
}, |
33 |
}, |
| 34 |
"dom": '<"top pager"ilpfB>tr<"bottom pager"ip>', |
34 |
"dom": '<"top pager"ilpfB>tr<"bottom pager"ip>', |
| 35 |
"buttons": [], |
35 |
"buttons": [{ |
|
|
36 |
fade: 100, |
| 37 |
className: "dt_button_clear_filter", |
| 38 |
titleAttr: _("Clear filter"), |
| 39 |
enabled: false, |
| 40 |
text: '<i class="fa fa-lg fa-remove"></i> <span class="dt-button-text">' + _("Clear filter") + '</span>', |
| 41 |
available: function ( dt ) { |
| 42 |
// The "clear filter" button is made available if this test returns true |
| 43 |
if( dt.settings()[0].aanFeatures.f ){ // aanFeatures.f is null if there is no search form |
| 44 |
return true; |
| 45 |
} |
| 46 |
}, |
| 47 |
action: function ( e, dt, node ) { |
| 48 |
dt.search( "" ).draw("page"); |
| 49 |
node.addClass("disabled"); |
| 50 |
} |
| 51 |
}], |
| 36 |
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, window.MSG_DT_ALL || "All"]], |
52 |
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, window.MSG_DT_ALL || "All"]], |
| 37 |
"iDisplayLength": 20 |
53 |
"iDisplayLength": 20, |
|
|
54 |
initComplete: function( settings) { |
| 55 |
var tableId = settings.nTable.id |
| 56 |
// When the DataTables search function is triggered, |
| 57 |
// enable or disable the "Clear filter" button based on |
| 58 |
// the presence of a search string |
| 59 |
$("#" + tableId ).on( 'search.dt', function ( e, settings ) { |
| 60 |
if( settings.oPreviousSearch.sSearch == "" ){ |
| 61 |
$("#" + tableId + "_wrapper").find(".dt_button_clear_filter").addClass("disabled"); |
| 62 |
} else { |
| 63 |
$("#" + tableId + "_wrapper").find(".dt_button_clear_filter").removeClass("disabled"); |
| 64 |
} |
| 65 |
}); |
| 66 |
} |
| 38 |
}; |
67 |
}; |
| 39 |
|
68 |
|
| 40 |
|
69 |
|
|
Lines 567-569
function footer_column_sum( api, column_numbers ) {
Link Here
|
| 567 |
$( api.column( column_number ).footer() ).html(total.format_price()); |
596 |
$( api.column( column_number ).footer() ).html(total.format_price()); |
| 568 |
}; |
597 |
}; |
| 569 |
} |
598 |
} |
| 570 |
- |
599 |
|
|
|
600 |
function filterDataTable( table, column, term ){ |
| 601 |
if( column ){ |
| 602 |
table.column( column ).search( term ).draw("page"); |
| 603 |
} else { |
| 604 |
table.search( term ).draw("page"); |
| 605 |
} |
| 606 |
} |