WIP: fix bootstrap table export options
This commit is contained in:
parent
7cbcd2d95c
commit
00ca30a205
1 changed files with 60 additions and 53 deletions
|
@ -30,7 +30,16 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.snipe-table').bootstrapTable('destroy').bootstrapTable({
|
$('.snipe-table').bootstrapTable('destroy').each(function () {
|
||||||
|
{{-- console.warn("Okay, what's 'this'?");
|
||||||
|
console.dir(this); --}}
|
||||||
|
export_options = JSON.parse($(this).attr('data-export-options'));
|
||||||
|
export_options['htmlContent'] = true //always append this to the given data-export-options
|
||||||
|
|
||||||
|
console.log("Export options on the table are:");
|
||||||
|
console.dir(export_options)
|
||||||
|
|
||||||
|
$(this).bootstrapTable({
|
||||||
classes: 'table table-responsive table-no-bordered',
|
classes: 'table table-responsive table-no-bordered',
|
||||||
ajaxOptions: {
|
ajaxOptions: {
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -75,9 +84,7 @@
|
||||||
export: 'fa-download',
|
export: 'fa-download',
|
||||||
clearSearch: 'fa-times'
|
clearSearch: 'fa-times'
|
||||||
},
|
},
|
||||||
exportOptions: {
|
exportOptions: export_options,
|
||||||
htmlContent: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
|
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
|
||||||
onLoadSuccess: function () {
|
onLoadSuccess: function () {
|
||||||
|
@ -85,7 +92,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue