2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

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

View File

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

View File

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

View File

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

View File

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

View File

@ -32,12 +32,7 @@ InvenTree | Supplier List
}); });
}); });
$("#company-table").bootstrapTable({ $("#company-table").inventreeTable({
sortable: true,
search: true,
pagination: true,
pageSize: 50,
pageList: [25, 50, 100, 'all'],
formatNoMatches: function() { return "No company information found"; }, formatNoMatches: function() { return "No company information found"; },
columns: [ 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> <thead>
<tr> <tr>
<th data-field='company' data-sortable='true' data-searchable='true'>Company</th> <th data-field='company' data-sortable='true' data-searchable='true'>Company</th>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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