|
Lines 40-68
var dataTablesDefaults = {
Link Here
|
| 40 |
dom: "t", |
40 |
dom: "t", |
| 41 |
buttons: ["clearFilter", "copy", "csv", "print"], |
41 |
buttons: ["clearFilter", "copy", "csv", "print"], |
| 42 |
paging: false, |
42 |
paging: false, |
| 43 |
buttons: [ |
|
|
| 44 |
{ |
| 45 |
fade: 100, |
| 46 |
className: "dt_button_clear_filter", |
| 47 |
titleAttr: __("Clear filter"), |
| 48 |
enabled: false, |
| 49 |
text: |
| 50 |
'<i class="fa fa-lg fa-times"></i> <span class="dt-button-text">' + |
| 51 |
__("Clear filter") + |
| 52 |
"</span>", |
| 53 |
available: function (dt) { |
| 54 |
// The "clear filter" button is made available if this test returns true |
| 55 |
if (dt.settings()[0].aanFeatures.f) { |
| 56 |
// aanFeatures.f is null if there is no search form |
| 57 |
return true; |
| 58 |
} |
| 59 |
}, |
| 60 |
action: function (e, dt, node) { |
| 61 |
dt.search("").draw("page"); |
| 62 |
node.addClass("disabled"); |
| 63 |
}, |
| 64 |
}, |
| 65 |
], |
| 66 |
initComplete: function (settings) { |
43 |
initComplete: function (settings) { |
| 67 |
var tableId = settings.nTable.id; |
44 |
var tableId = settings.nTable.id; |
| 68 |
state = settings.oLoadedState; |
45 |
state = settings.oLoadedState; |
|
Lines 183-203
function _dt_buttons(params) {
Link Here
|
| 183 |
}, |
160 |
}, |
| 184 |
]; |
161 |
]; |
| 185 |
|
162 |
|
| 186 |
let buttons = []; |
163 |
let buttons = [ |
| 187 |
buttons.push({ |
164 |
{ |
| 188 |
fade: 100, |
165 |
fade: 100, |
| 189 |
className: "dt_button_clear_filter", |
166 |
className: "dt_button_clear_filter", |
| 190 |
titleAttr: __("Clear filter"), |
167 |
titleAttr: _("Clear filter"), |
| 191 |
enabled: false, |
168 |
enabled: false, |
| 192 |
text: |
169 |
text: |
| 193 |
'<i class="fa fa-lg fa-remove"></i> <span class="dt-button-text">' + |
170 |
'<i class="fa fa-lg fa-times" aria-hidden="true"></i> <span class="dt-button-text">' + |
| 194 |
__("Clear filter") + |
171 |
_("Clear filter") + |
| 195 |
"</span>", |
172 |
"</span>", |
| 196 |
action: function (e, dt, node, config) { |
173 |
action: function (e, dt, node, config) { |
| 197 |
dt.search("").draw("page"); |
174 |
dt.search("").draw("page"); |
| 198 |
node.addClass("disabled"); |
175 |
node.addClass("disabled"); |
|
|
176 |
}, |
| 199 |
}, |
177 |
}, |
| 200 |
}); |
178 |
{ |
|
|
179 |
extend: "csvHtml5", |
| 180 |
text: _("CSV"), |
| 181 |
exportOptions: { |
| 182 |
columns: exportColumns, |
| 183 |
format: export_format, |
| 184 |
}, |
| 185 |
}, |
| 186 |
{ |
| 187 |
extend: "copyHtml5", |
| 188 |
text: _("Copy"), |
| 189 |
exportOptions: { |
| 190 |
columns: exportColumns, |
| 191 |
format: export_format, |
| 192 |
}, |
| 193 |
}, |
| 194 |
{ |
| 195 |
extend: "print", |
| 196 |
text: _("Print"), |
| 197 |
exportOptions: { |
| 198 |
columns: exportColumns, |
| 199 |
format: export_format, |
| 200 |
}, |
| 201 |
}, |
| 202 |
]; |
| 201 |
|
203 |
|
| 202 |
// Retrieving bKohaColumnsUseNames from the options passed to the constructor, not DT's settings |
204 |
// Retrieving bKohaColumnsUseNames from the options passed to the constructor, not DT's settings |
| 203 |
// But ideally should be retrieved using table.data() |
205 |
// But ideally should be retrieved using table.data() |
|
Lines 234-252
function _dt_buttons(params) {
Link Here
|
| 234 |
}); |
236 |
}); |
| 235 |
} |
237 |
} |
| 236 |
|
238 |
|
| 237 |
buttons.push({ |
|
|
| 238 |
extend: "collection", |
| 239 |
autoClose: true, |
| 240 |
fade: 100, |
| 241 |
className: "export_controls", |
| 242 |
titleAttr: __("Export or print"), |
| 243 |
text: |
| 244 |
'<i class="fa fa-lg fa-download"></i> <span class="dt-button-text">' + |
| 245 |
__("Export") + |
| 246 |
"</span>", |
| 247 |
buttons: export_buttons, |
| 248 |
}); |
| 249 |
|
| 250 |
return buttons; |
239 |
return buttons; |
| 251 |
} |
240 |
} |
| 252 |
|
241 |
|
| 253 |
- |
|
|