|
Lines 56-73
var dataTablesDefaults = {
Link Here
|
| 56 |
"pageLength": 20, |
56 |
"pageLength": 20, |
| 57 |
"fixedHeader": true, |
57 |
"fixedHeader": true, |
| 58 |
initComplete: function( settings ) { |
58 |
initComplete: function( settings ) { |
| 59 |
var tableId = settings.nTable.id |
59 |
$(this).kohaTableToggleClearFilter(settings); |
| 60 |
var state = settings.oLoadedState; |
|
|
| 61 |
state && toggledClearFilter(state.search.search, tableId); |
| 62 |
// When the DataTables search function is triggered, |
| 63 |
// enable or disable the "Clear filter" button based on |
| 64 |
// the presence of a search string |
| 65 |
$(this).on( 'search.dt', function ( e, settings ) { |
| 66 |
toggledClearFilter(settings.oPreviousSearch.sSearch, tableId); |
| 67 |
}); |
| 68 |
|
60 |
|
| 69 |
if (settings.ajax) { |
61 |
if (settings.ajax) { |
| 70 |
let table_node = $("#" + tableId); |
62 |
let table_node = $("#" + settings.nTable.id); |
| 71 |
if ( typeof this.api === 'function' ) { |
63 |
if ( typeof this.api === 'function' ) { |
| 72 |
_dt_add_delay(this.api(), table_node); |
64 |
_dt_add_delay(this.api(), table_node); |
| 73 |
} else { |
65 |
} else { |
|
Lines 1007-1010
function _dt_add_delay(table_dt, table_node, delay_ms) {
Link Here
|
| 1007 |
return table; |
999 |
return table; |
| 1008 |
}; |
1000 |
}; |
| 1009 |
|
1001 |
|
|
|
1002 |
$.fn.kohaTableToggleClearFilter = function(settings) { |
| 1003 |
var tableId = settings.nTable.id |
| 1004 |
var state = settings.oLoadedState; |
| 1005 |
state && toggledClearFilter(state.search.search, tableId); |
| 1006 |
// When the DataTables search function is triggered, |
| 1007 |
// enable or disable the "Clear filter" button based on |
| 1008 |
// the presence of a search string |
| 1009 |
this.on( 'search.dt', function ( e, settings ) { |
| 1010 |
toggledClearFilter(settings.oPreviousSearch.sSearch, tableId); |
| 1011 |
}); |
| 1012 |
} |
| 1013 |
|
| 1014 |
|
| 1010 |
})(jQuery); |
1015 |
})(jQuery); |
| 1011 |
- |
|
|