Update a bunch more tables

This commit is contained in:
Oliver Walters 2019-09-22 22:18:53 +10:00
parent 2046c12600
commit ae2e2f36e4
20 changed files with 26 additions and 88 deletions

View File

@ -42,14 +42,10 @@ function loadStockTable(table, options) {
var params = options.params || {};
table.bootstrapTable({
sortable: true,
search: true,
console.log('load stock table');
table.inventreeTable({
method: 'get',
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
rememberOrder: true,
formatNoMatches: function() {
return 'No stock items matching query';
},
@ -387,15 +383,10 @@ function loadStockTrackingTable(table, options) {
}
});
table.bootstrapTable({
sortable: true,
search: true,
table.inventreeTable({
method: 'get',
rememberOrder: true,
queryParams: options.params,
columns: cols,
pagination: true,
pageSize: 50,
url: options.url,
});

View File

@ -60,6 +60,7 @@ $.fn.inventreeTable = function(options) {
options.sortable = true;
options.search = true;
// Callback to save pagination data
options.onPageChange = function(number, size) {
inventreeSave(varName, size);
};

View File

@ -62,9 +62,7 @@ InvenTree | Allocate Parts
{% else %}
$("#build-list").bootstrapTable({
search: true,
sortable: true,
$("#build-list").inventreeTable({
});
$("#btn-allocate").click(function() {

View File

@ -45,12 +45,7 @@
});
});
$("#part-table").bootstrapTable({
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
$("#part-table").inventreeTable({
formatNoMatches: function() { return "No supplier parts found for {{ company.name }}"; },
queryParams: function(p) {
return {

View File

@ -42,9 +42,7 @@
newOrder();
});
$("#po-table").bootstrapTable({
search: true,
sortable: true,
$(".po-table").inventreeTable({
});
{% endblock %}

View File

@ -32,12 +32,7 @@ InvenTree | Supplier List
});
});
$("#company-table").bootstrapTable({
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
$("#company-table").inventreeTable({
formatNoMatches: function() { return "No company information found"; },
columns: [
{

View File

@ -1,4 +1,4 @@
<table class='table table-striped table-condensed' id='po-table' {% if toolbar %}data-toolbar='{{ toolbar }}'{% endif %}>
<table class='table table-striped table-condensed po-table' id='po-table' {% if toolbar %}data-toolbar='{{ toolbar }}'{% endif %}>
<thead>
<tr>
<th data-field='company' data-sortable='true' data-searchable='true'>Company</th>

View File

@ -221,9 +221,7 @@ $('#new-po-line').click(function() {
});
{% endif %}
$("#po-lines-table").bootstrapTable({
search: true,
sortable: true,
$("#po-lines-table").inventreeTable({
});

View File

@ -32,8 +32,7 @@ $("#po-create").click(function() {
);
});
$("#po-table").bootstrapTable({
search: true,
$("#po-table").inventreeTable({
});
{% endblock %}

View File

@ -29,9 +29,7 @@
{% block js_ready %}
$("#build-table").bootstrapTable({
search: true,
sortable: true,
$("#build-table").inventreeTable({
columns: [
{
title: 'Build',

View File

@ -89,9 +89,7 @@
});
});
$("#attachment-table").bootstrapTable({
search: true,
sortable: true,
$("#attachment-table").inventreeTable({
});
{% endblock %}

View File

@ -31,12 +31,7 @@
});
});
$("#build-table").bootstrapTable({
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
$("#build-table").inventreeTable({
queryParams: function(p) {
return {
part: {{ part.id }},

View File

@ -26,9 +26,7 @@
{% block js_ready %}
{{ block.super }}
$("#po-table").bootstrapTable({
search: true,
sortable: true,
$("#po-table").inventreeTable({
});
$("#part-order2").click(function() {

View File

@ -44,9 +44,7 @@
{% block js_ready %}
{{ block.super }}
$('#param-table').bootstrapTable({
search: true,
sortable: true,
$('#param-table').inventreeTable({
});
$('#param-create').click(function() {

View File

@ -50,9 +50,7 @@
});
});
$("#supplier-table").bootstrapTable({
sortable: true,
search: true,
$("#supplier-table").inventreeTable({
formatNoMatches: function() { return "No supplier parts available for {{ part.full_name }}"; },
queryParams: function(p) {
return {

View File

@ -16,9 +16,7 @@
{% block js_ready %}
{{ block.super }}
$("#used-table").bootstrapTable({
sortable: true,
search: true,
$("#used-table").inventreeTable({
formatNoMatches: function() { return "{{ part.full_name }} is not used to make any other parts"; },
queryParams: function(p) {
return {

View File

@ -53,9 +53,7 @@
{{ block.super }}
$('#variant-table').bootstrapTable({
search: true,
sortable: true,
$('#variant-table').inventreeTable({
});
$('#new-variant').click(function() {

View File

@ -83,7 +83,7 @@ InvenTree | Search Results
onSearchResults('#supplier-part-results-table', '#supplier-part-result-count');
$("#category-results-table").bootstrapTable({
$("#category-results-table").inventreeTable({
url: "{% url 'api-part-category-list' %}",
queryParams: {
search: "{{ query }}",
@ -103,7 +103,7 @@ InvenTree | Search Results
],
});
$("#location-results-table").bootstrapTable({
$("#location-results-table").inventreeTable({
url: "{% url 'api-location-list' %}",
queryParams: {
search: "{{ query }}",
@ -134,15 +134,11 @@ InvenTree | Search Results
}
);
$("#company-results-table").bootstrapTable({
$("#company-results-table").inventreeTable({
url: "{% url 'api-company-list' %}",
queryParams: {
search: "{{ query }}",
},
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
search: true,
columns: [
{
field: 'name',
@ -158,15 +154,11 @@ InvenTree | Search Results
]
});
$("#supplier-part-results-table").bootstrapTable({
$("#supplier-part-results-table").inventreeTable({
url: "{% url 'api-part-supplier-list' %}",
queryParams: {
search: "{{ query }}",
},
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
search: true,
columns: [
{
field: 'supplier_name',

View File

@ -19,16 +19,11 @@
{% block js_ready %}
{{ block.super }}
$("#currency-table").bootstrapTable({
$("#currency-table").inventreeTable({
url: "{% url 'api-currency-list' %}",
queryParams: {
ordering: 'suffix'
},
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
formatNoMatches: function() { return "No currencies found"; },
rowStyle: function(row, index) {
if (row.base) {

View File

@ -19,16 +19,11 @@
{% block js_ready %}
{{ block.super }}
$("#param-table").bootstrapTable({
$("#param-table").inventreeTable({
url: "{% url 'api-part-param-template-list' %}",
queryParams: {
ordering: 'name',
},
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
formatNoMatches: function() { return "No part parameter templates found"; },
columns: [
{