mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a custom "id" to the progress bar
This commit is contained in:
parent
4979c690d9
commit
15166c7797
@ -97,8 +97,10 @@ function makeProgressBar(value, maximum, opts) {
|
|||||||
percent = 100;
|
percent = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var id = opts.id || 'progress-bar';
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div class='progress'>
|
<div id='${id}' class='progress'>
|
||||||
<div class='progress-bar' role='progressbar' aria-valuenow='${percent}' aria-valuemin='0' aria-valuemax='100' style='width:${percent}%'></div>
|
<div class='progress-bar' role='progressbar' aria-valuenow='${percent}' aria-valuemin='0' aria-valuemax='100' style='width:${percent}%'></div>
|
||||||
<div class='progress-value'>${value} / ${maximum}</div>
|
<div class='progress-value'>${value} / ${maximum}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -133,7 +133,9 @@ $("#so-lines-table").inventreeTable({
|
|||||||
field: 'quantity',
|
field: 'quantity',
|
||||||
title: 'Quantity',
|
title: 'Quantity',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
return makeProgressBar(row.allocated, row.quantity);
|
return makeProgressBar(row.allocated, row.quantity, {
|
||||||
|
id: `order-line-progress-${row.pk}`,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
sorter: function(valA, valB, rowA, rowB) {
|
sorter: function(valA, valB, rowA, rowB) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user