|
Lines 237-242
$.fn.dataTable.ext.buttons.clearFilter = {
Link Here
|
| 237 |
} |
237 |
} |
| 238 |
}; |
238 |
}; |
| 239 |
|
239 |
|
|
|
240 |
var export_format_spreadsheet = { |
| 241 |
body: function ( data, row, column, node ) { |
| 242 |
var newnode = node.cloneNode(true); |
| 243 |
var no_export_nodes = newnode.querySelectorAll(".no-export"); |
| 244 |
no_export_nodes.forEach(child => { |
| 245 |
child.parentNode.removeChild(child); |
| 246 |
}); |
| 247 |
//Note: innerHTML is the same thing as the data variable, |
| 248 |
//minus the ".no-export" nodes that we've removed |
| 249 |
//Note: See dataTables.buttons.js for original function usage |
| 250 |
var str = DataTable.Buttons.stripData(newnode.innerHTML, { |
| 251 |
decodeEntities: false, |
| 252 |
stripHtml: true, |
| 253 |
stripNewlines: true, |
| 254 |
trim: true, |
| 255 |
escapeExcelFormula: true, |
| 256 |
}); |
| 257 |
//Note: escapeExcelFormula only works from Buttons 3.2.0+, so |
| 258 |
//we add a workaround for now |
| 259 |
var unsafeCharacters = /^[=+\-@\t\r]/; |
| 260 |
if (unsafeCharacters.test(str)) { |
| 261 |
str = "'" + str; |
| 262 |
} |
| 263 |
return str; |
| 264 |
}, |
| 265 |
}; |
| 266 |
|
| 240 |
var export_buttons = [ |
267 |
var export_buttons = [ |
| 241 |
{ |
268 |
{ |
| 242 |
extend: 'excelHtml5', |
269 |
extend: 'excelHtml5', |
|
Lines 251-257
$.fn.dataTable.ext.buttons.clearFilter = {
Link Here
|
| 251 |
text: __("CSV"), |
278 |
text: __("CSV"), |
| 252 |
exportOptions: { |
279 |
exportOptions: { |
| 253 |
columns: exportColumns, |
280 |
columns: exportColumns, |
| 254 |
format: export_format |
281 |
format: export_format_spreadsheet |
| 255 |
}, |
282 |
}, |
| 256 |
}, |
283 |
}, |
| 257 |
{ |
284 |
{ |
| 258 |
- |
|
|