mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Add a custom "id" to the progress bar
This commit is contained in:
		| @@ -97,8 +97,10 @@ function makeProgressBar(value, maximum, opts) { | ||||
|         percent = 100; | ||||
|     } | ||||
|  | ||||
|     var id = opts.id || 'progress-bar'; | ||||
|  | ||||
|     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-value'>${value} / ${maximum}</div> | ||||
|     </div> | ||||
|   | ||||
| @@ -133,7 +133,9 @@ $("#so-lines-table").inventreeTable({ | ||||
|             field: 'quantity', | ||||
|             title: 'Quantity', | ||||
|             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) { | ||||
|                  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user