Add select column to BOM table

- Doesn't do anything yet
This commit is contained in:
Oliver Walters 2019-04-18 21:40:09 +10:00
parent 8948536f0f
commit bcebb1c73c

View File

@ -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 = "<button class='btn btn-success bom-edit-button btn-sm' type='button' url='" + row.url + "edit'>Edit</button>";
var bDelt = "<button class='btn btn-danger bom-delete-button btn-sm' type='button' url='" + row.url + "delete'>Delete</button>";
return "<div class='btn-group'>" + bEdit + bDelt + "</div>";
}
});
}
// 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 = "<button class='btn btn-success bom-edit-button btn-sm' type='button' url='" + row.url + "edit'>Edit</button>";
var bDelt = "<button class='btn btn-danger bom-delete-button btn-sm' type='button' url='" + row.url + "delete'>Delete</button>";
return "<div class='btn-group'>" + bEdit + bDelt + "</div>";
}
});
}
else {
cols.push(
{
field: 'sub_part.available_stock',