www/js/inv_fermentables.js

changeset 18
395833e20f88
parent 11
d341f0a91a91
child 30
f5ab22446aa5
--- a/www/js/inv_fermentables.js	Mon Aug 13 23:01:25 2018 +0200
+++ b/www/js/inv_fermentables.js	Thu Aug 16 16:01:13 2018 +0200
@@ -72,8 +72,7 @@
 			{ name: 'inventory', type: 'float' },
 			{ name: 'cost', type: 'float' },
 			{ name: 'production_date', type: 'string' },
-			{ name: 'tht_date', type: 'string' },
-			{ name: 'supplier_rec', type: 'float' }
+			{ name: 'tht_date', type: 'string' }
 		],
 		id: 'record',
 		url: url,
@@ -127,15 +126,16 @@
 		}
 	};
 	var srcType = [ "Grain", "Sugar", "Extract", "Dry Extract", "Adjunct" ];
+	var srcGraintype = [ "Base", "Crystal", "Special", "Roast", "Kilned", "No malt" ];
 	// initialize the input fields.
 	$("#name").jqxInput({ theme: theme, width: 250, height: 23 });
-	$("#type").jqxDropDownList({ theme: theme, source: srcType, width: 90, height: 23, dropDownHeight: 130 });
+	$("#type").jqxDropDownList({ theme: theme, source: srcType, width: 100, height: 23, dropDownHeight: 156 });
 	$("#yield").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#color").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#add_after_boil").jqxCheckBox({ theme: theme, width: 120, height: 23 });
 	$("#origin").jqxInput({ theme: theme, width: 250, height: 23 });
 	$("#supplier").jqxInput({ theme: theme, width: 250, height: 23 });
-	$("#notes").jqxInput({ theme: theme, width: 640, height: 48 });
+	$("#notes").jqxInput({ theme: theme, width: 640, height: 100 });
 	$("#coarse_fine_diff").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#moisture").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#diastatic_power").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
@@ -146,16 +146,13 @@
 	$("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 });
 	$("#di_ph").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
-
-	$("#graintype").jqxInput({ theme: theme, width: 250, height: 23 });
+	$("#graintype").jqxDropDownList({ theme: theme, source: srcGraintype, width: 100, height: 23, dropDownHeight: 185 });
 
 	$("#inventory").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
 	$("#production_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
 
 	$("#cost").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true });
 	$("#tht_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
-	$("#supplier_rec").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
-	// supplier_rec
 	var dataAdapter = new $.jqx.dataAdapter(source);
 	var editrow = -1;
 	// initialize jqxGrid
@@ -175,7 +172,7 @@
 			// add new row.
 			addButton.click(function (event) {
 				editrow = -1;
-				$("#popupWindow").jqxWindow({ position: { x: 230, y: 10 } });
+				$("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } });
 				$("#name").val('');
 				$("#type").val('Grain');
 				$("#origin").val('');
@@ -196,7 +193,6 @@
 				$("#cost").val('');
 				$("#production_date").val('');
 				$("#tht_date").val('');
-				$("#supplier_rec").val('');
 				$("#popupWindow").jqxWindow('open');
 			});
 		},
@@ -205,6 +201,7 @@
 		columns: [
 			{ text: 'Vergistbaar product', datafield: 'name', width: 250 },
 			{ text: 'Soort', datafield: 'type', width: 90 },
+			{ text: 'Mout type', datafield: 'graintype', width: 90 },
 			{ text: 'Herkomst', datafield: 'origin', width: 150 },
 			{ text: 'Producent', datafield: 'supplier', width: 150 },
 			{ text: 'Kleur', datafield: 'color', width: 70, cellsalign: 'right' },
@@ -216,7 +213,7 @@
 				}, buttonclick: function (row) {
 					// open the popup window when the user clicks a button.
 					editrow = row;
-					$("#popupWindow").jqxWindow({ position: { x: 230, y: 10 } });
+					$("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } });
 					// get the clicked row's data and initialize the input fields.
 					var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
 					$("#name").val(dataRecord.name);
@@ -242,7 +239,6 @@
 					$("#cost").val(dataRecord.cost);
 					$("#production_date").val(dataRecord.production_date);
 					$("#tht_date").val(dataRecord.tht_date);
-					$("#supplier_rec").val(dataRecord.supplier_rec);
 					// show the popup window.
 					$("#popupWindow").jqxWindow('open');
 				}
@@ -299,7 +295,6 @@
 				cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 				production_date: $("#production_date").val(),
 				tht_date: $("#tht_date").val(),
-				supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal'))
 			};
 			$('#jqxgrid').jqxGrid('updaterow', rowID, row);
 			$("#popupWindow").jqxWindow('hide');
@@ -330,7 +325,6 @@
 				cost: parseFloat($("#cost").jqxNumberInput('decimal')),
 				production_date: $("#production_date").val(),
 				tht_date: $("#tht_date").val(),
-				supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal'))
 			};
 			$('#jqxgrid').jqxGrid('addrow', null, newrow);
 			$("#popupWindow").jqxWindow('hide');

mercurial