diff --git a/app/static/js/items.js b/app/static/js/items.js index 572918819a1b7c18ad771e46bc30ae5409889b3e..5eeccef6249f919644b0176639e5377c8aeda139 100644 --- a/app/static/js/items.js +++ b/app/static/js/items.js @@ -93,18 +93,20 @@ $(document).ready(function() { ] }); - new $.fn.dataTable.Buttons(items_table, { - buttons: [ - { - text: '<span class="oi oi-data-transfer-download" title="Export to excel file" aria-hidden="true"></span> Excel', - className: "btn-outline-secondary", - action: function ( e, dt, node, conf ) { - download_excel(); + if( $("#items_table").length ) { + new $.fn.dataTable.Buttons(items_table, { + buttons: [ + { + text: '<span class="oi oi-data-transfer-download" title="Export to excel file" aria-hidden="true"></span> Excel', + className: "btn-outline-secondary", + action: function ( e, dt, node, conf ) { + download_excel(); + } } - } - ] - }); + ] + }); - items_table.buttons().container().appendTo("#items_table_wrapper .col-md-3:eq(0)"); + items_table.buttons().container().appendTo("#items_table_wrapper .col-md-3:eq(0)"); + } });