diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index 223372a767..13532db35b 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -1036,9 +1036,12 @@ function loadBuildOutputTable(build_info, options={}) { // Now that the allocations have been grouped by stock item, // we can update each row in the table, // using the pk value of each row (stock item) + + var data = []; + rows.forEach(function(row) { row.allocations = allocations[row.pk] || []; - $(table).bootstrapTable('updateByUniqueId', row.pk, row, true); + data.push(row); var n_completed_lines = 0; @@ -1066,6 +1069,9 @@ function loadBuildOutputTable(build_info, options={}) { } }); }); + + // Reload table with updated data + $(table).bootstrapTable('load', data); } } ); @@ -1108,6 +1114,7 @@ function loadBuildOutputTable(build_info, options={}) { { success: function(results) { + var data = []; // Iterate through each row and find matching test results rows.forEach(function(row) { var test_results = {}; @@ -1124,8 +1131,10 @@ function loadBuildOutputTable(build_info, options={}) { row.passed_tests = test_results; - $(table).bootstrapTable('updateByUniqueId', row.pk, row, true); + data.push(row); }); + + $(table).bootstrapTable('load', row); } } ); @@ -1466,7 +1475,6 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { function redrawAllocationData() { // Force a refresh of each row in the table // Note we cannot call 'refresh' because we are passing data from memory - // var rows = $(table).bootstrapTable('getData'); // How many rows are fully allocated? var allocated_rows = 0; @@ -1678,7 +1686,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { setupCallbacks(); }, sortable: true, - showColumns: false, + showColumns: true, detailView: true, detailFilter: function(index, row) { return allocatedQuantity(row) > 0; @@ -1809,6 +1817,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { field: 'sub_part_detail.full_name', title: '{% trans "Required Part" %}', sortable: true, + switchable: false, formatter: function(value, row) { var url = `/part/${row.sub_part}/`; var thumb = row.sub_part_detail.thumbnail; @@ -1833,16 +1842,37 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { field: 'reference', title: '{% trans "Reference" %}', sortable: true, + switchable: true, + }, + { + field: 'consumable', + title: '{% trans "Consumable" %}', + sortable: true, + switchable: true, + formatter: function(value) { + return yesNoLabel(value); + } + }, + { + field: 'optional', + title: '{% trans "Optional" %}', + sortable: true, + switchable: true, + formatter: function(value) { + return yesNoLabel(value); + } }, { field: 'quantity', title: '{% trans "Quantity Per" %}', sortable: true, + switchable: false, }, { field: 'available_stock', title: '{% trans "Available" %}', sortable: true, + switchable: true, formatter: function(value, row) { var url = `/part/${row.sub_part_detail.pk}/?display=part-stock`; @@ -1906,6 +1936,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { field: 'allocated', title: '{% trans "Allocated" %}', sortable: true, + switchable: false, formatter: function(value, row) { var required = requiredQuantity(row); var allocated = row.consumable ? required : allocatedQuantity(row); @@ -1946,6 +1977,8 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { { field: 'actions', title: '{% trans "Actions" %}', + switchable: false, + sortable: false, formatter: function(value, row) { if (row.consumable) {