diff --git a/InvenTree/InvenTree/static/script/inventree/part.js b/InvenTree/InvenTree/static/script/inventree/part.js index ec4b77eead..0904c22a0d 100644 --- a/InvenTree/InvenTree/static/script/inventree/part.js +++ b/InvenTree/InvenTree/static/script/inventree/part.js @@ -191,7 +191,7 @@ function loadPartTable(table, url, options={}) { } }); - inventreeTable(table, { + $(table).inventreeTable({ url: url, sortName: 'name', method: 'get', diff --git a/InvenTree/InvenTree/static/script/inventree/tables.js b/InvenTree/InvenTree/static/script/inventree/tables.js index 8e9d3ccf84..4a129132e0 100644 --- a/InvenTree/InvenTree/static/script/inventree/tables.js +++ b/InvenTree/InvenTree/static/script/inventree/tables.js @@ -47,8 +47,7 @@ function isNumeric(n) { /* Wrapper function for bootstrapTable. * Sets some useful defaults, and manage persistent settings. */ - -function inventreeTable(table, options) { +$.fn.inventreeTable = function(options) { var tableName = options.name || 'table'; @@ -66,7 +65,7 @@ function inventreeTable(table, options) { }; // Standard options for all tables - $(table).bootstrapTable(options); + this.bootstrapTable(options); } function customGroupSorter(sortName, sortOrder, sortData) { diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html index 3c9eda3544..fb75d0586a 100644 --- a/InvenTree/build/templates/build/index.html +++ b/InvenTree/build/templates/build/index.html @@ -44,9 +44,7 @@ InvenTree | Build List }); }); - $(".build-table").bootstrapTable({ - sortable: true, - search: true, + $(".build-table").inventreeTable({ formatNoMatches: function() { return 'No builds found'; }, columns: [ {