From bcebb1c73c87597dbcec4e41ce1164300b2be93f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 18 Apr 2019 21:40:09 +1000 Subject: [PATCH] Add select column to BOM table - Doesn't do anything yet --- InvenTree/static/script/inventree/bom.js | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/InvenTree/static/script/inventree/bom.js b/InvenTree/static/script/inventree/bom.js index 7e8fec103c..3d8db7d7e2 100644 --- a/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/static/script/inventree/bom.js @@ -75,20 +75,15 @@ function loadBomTable(table, options) { field: 'pk', title: 'ID', visible: false, - } + }, + { + checkbox: true, + title: 'Select', + searchable: false, + sortable: false, + }, ]; - if (options.editable) { - cols.push({ - formatter: function(value, row, index, field) { - var bEdit = ""; - var bDelt = ""; - - return "
" + bEdit + bDelt + "
"; - } - }); - } - // Part column cols.push( { @@ -129,8 +124,17 @@ function loadBomTable(table, options) { } ); - // If we are NOT editing, display the available stock - if (!options.editable) { + if (options.editable) { + cols.push({ + formatter: function(value, row, index, field) { + var bEdit = ""; + var bDelt = ""; + + return "
" + bEdit + bDelt + "
"; + } + }); + } + else { cols.push( { field: 'sub_part.available_stock',