Improved fermentables grid display for priming sugars.

Fri, 14 Jun 2019 17:08:05 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 14 Jun 2019 17:08:05 +0200
changeset 410
72ba4a5e8ebc
parent 409
d24269303f0b
child 411
077ada2dda9b

Improved fermentables grid display for priming sugars.

www/js/prod_edit.js file | annotate | diff | comparison | revisions
--- a/www/js/prod_edit.js	Fri Jun 14 16:05:57 2019 +0200
+++ b/www/js/prod_edit.js	Fri Jun 14 17:08:05 2019 +0200
@@ -3411,6 +3411,8 @@
 				},
                                 { text: 'Procent', datafield: 'f_percentage', width: 90, align: 'right',
 				  cellsrenderer:  function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {
+					if (rowdata.f_added >= 4)
+						return '<span></span>';
 					var color = '#ffffff';
 					if (value > rowdata.f_max_in_batch)
 						color = '#ff4040';
@@ -3418,16 +3420,22 @@
 						color + ';">' +fermentableAdapter.formatNumber(value, "p1") + '</span>';
 				  }
 				},
-                                { text: '100%', align: 'center', datafield: 'f_adjust_to_total_100', columntype: 'checkbox', width: 70 },
+                                { text: '100%', datafield: 'f_adjust_to_total_100', width: 70, align: 'center', cellsalign: 'center',
+				  cellsrenderer:  function (index, datafield, value, defaultvalue, column, rowdata) {
+					if (value == 0)
+						return '<span></span>';
+					return  '<span><img style="float:left; margin-left:25px; margin-top:4px;" src="images/dialog-ok-apply.png"></span>';
+				  }
+				},
 				{ text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () {
 					return "Wijzig";
 					}, buttonclick: function (row) {
 						fermentableRow = row;
 						fermentableData = $("#fermentableGrid").jqxGrid('getrowdata', fermentableRow);
-						if (dataRecord.stage > 3) {
+						if (fermentableData.f_added >= 4) {
+							alert("Wijzig dit in de Verpakken tab");
+						} else if (dataRecord.stage > 3) {
 							alert("Ingredie├źnt is al verwerkt.");
-						} else if (fermentableData.f_added >= 4) {
-							alert("Wijzig dit in de Verpakken tab");
 						} else {
 							$("#wf_name").val(fermentableData.f_name);
 							$("#wf_amount").val(fermentableData.f_amount);

mercurial