mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add select column to BOM table
- Doesn't do anything yet
This commit is contained in:
parent
8948536f0f
commit
bcebb1c73c
@ -75,20 +75,15 @@ function loadBomTable(table, options) {
|
|||||||
field: 'pk',
|
field: 'pk',
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
visible: false,
|
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
|
// Part column
|
||||||
cols.push(
|
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(
|
cols.push(
|
||||||
{
|
{
|
||||||
field: 'sub_part.available_stock',
|
field: 'sub_part.available_stock',
|
||||||
|
Loading…
Reference in New Issue
Block a user