mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Use a jQuerified function
This commit is contained in:
parent
df41fafefb
commit
2046c12600
@ -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',
|
||||||
|
@ -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) {
|
||||||
|
@ -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: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user