www/js/inv_hops.js

changeset 514
3c680d1dea35
parent 488
77f1617b6994
child 528
202272a28052
--- a/www/js/inv_hops.js	Mon Oct 14 23:13:40 2019 +0200
+++ b/www/js/inv_hops.js	Wed Oct 16 21:05:03 2019 +0200
@@ -65,8 +65,8 @@
 			{ name: 'cohumulone', type: 'float' },
 			{ name: 'myrcene', type: 'float' },
 			{ name: 'hsi', type: 'float' },
-			{ name: 'type', type: 'int' },
-			{ name: 'form', type: 'int' },
+			{ name: 'type', type: 'string' },
+			{ name: 'form', type: 'string' },
 			{ name: 'notes', type: 'string' },
 			{ name: 'origin', type: 'string' },
 			{ name: 'substitutes', type: 'string' },
@@ -148,7 +148,7 @@
 	$("#type").jqxDropDownList({
 		theme: theme,
 		source: HopTypeAdapter,
-		valueMember: 'id',
+		valueMember: 'nl',
 		displayMember: 'nl',
 		width: 150,
 		height: 23,
@@ -157,7 +157,7 @@
 	$("#form").jqxDropDownList({
 		theme: theme,
 		source: HopFormAdapter,
-		valueMember: 'id',
+		valueMember: 'nl',
 		displayMember: 'nl',
 		width: 150,
 		height: 23,
@@ -203,8 +203,8 @@
 				$("#cohumulone").val(0);
 				$("#myrcene").val(0);
 				$("#hsi").val(0);
-				$("#type").val(0);
-				$("#form").val(0);
+				$("#type").val('Bitterhop');
+				$("#form").val('Pellets');
 				$("#notes").val('');
 				$("#origin").val('');
 				$("#substitutes").val('');
@@ -225,16 +225,8 @@
 		columns: [
 			{ text: 'Herkomst', datafield: 'origin', width: 150 },
 			{ text: 'Hop Naam', datafield: 'name', menu: false },
-			{ text: 'Soort', datafield: 'type', align: 'left', menu: false, width: 90,
-			  cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
-				return  '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopTypeData[value].nl + '</span>';
-			  }
-			},
-			{ text: 'Vorm', datafield: 'form', align: 'left', menu: false, width: 90,
-			  cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
-				return  '<span style="margin: 4px; margin-top: 6px; float: left;">' + HopFormData[value].nl + '</span>';
-			  }
-		       	},
+			{ text: 'Soort', datafield: 'type', align: 'left', width: 90 },
+			{ text: 'Vorm', datafield: 'form', align: 'left', width: 90 },
 			{ text: 'Alpha %', datafield: 'alpha', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' },
 			{ text: 'Beta %', datafield: 'beta', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' },
 			{ text: 'Cohumuloon %%', datafield: 'cohumulone', width: 80, align: 'right', cellsalign: 'right', menu: false, cellsformat: 'p1' },

mercurial