Use a jQuerified function

This commit is contained in:
Oliver Walters 2019-09-22 21:56:57 +10:00
parent df41fafefb
commit 2046c12600
3 changed files with 4 additions and 7 deletions

View File

@ -191,7 +191,7 @@ function loadPartTable(table, url, options={}) {
} }
}); });
inventreeTable(table, { $(table).inventreeTable({
url: url, url: url,
sortName: 'name', sortName: 'name',
method: 'get', method: 'get',

View File

@ -47,8 +47,7 @@ function isNumeric(n) {
/* Wrapper function for bootstrapTable. /* Wrapper function for bootstrapTable.
* Sets some useful defaults, and manage persistent settings. * Sets some useful defaults, and manage persistent settings.
*/ */
$.fn.inventreeTable = function(options) {
function inventreeTable(table, options) {
var tableName = options.name || 'table'; var tableName = options.name || 'table';
@ -66,7 +65,7 @@ function inventreeTable(table, options) {
}; };
// Standard options for all tables // Standard options for all tables
$(table).bootstrapTable(options); this.bootstrapTable(options);
} }
function customGroupSorter(sortName, sortOrder, sortData) { function customGroupSorter(sortName, sortOrder, sortData) {

View File

@ -44,9 +44,7 @@ InvenTree | Build List
}); });
}); });
$(".build-table").bootstrapTable({ $(".build-table").inventreeTable({
sortable: true,
search: true,
formatNoMatches: function() { return 'No builds found'; }, formatNoMatches: function() { return 'No builds found'; },
columns: [ columns: [
{ {