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,
sortName: 'name',
method: 'get',

View File

@ -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) {

View File

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