www/js/inv_miscs.js

changeset 514
3c680d1dea35
parent 488
77f1617b6994
child 528
202272a28052
--- a/www/js/inv_miscs.js	Mon Oct 14 23:13:40 2019 +0200
+++ b/www/js/inv_miscs.js	Wed Oct 16 21:05:03 2019 +0200
@@ -67,8 +67,8 @@
 		datafields: [
 			{ name: 'record', type: 'number' },
 			{ name: 'name', type: 'string' },
-			{ name: 'type', type: 'int' },
-			{ name: 'use_use', type: 'int' },
+			{ name: 'type', type: 'string' },
+			{ name: 'use_use', type: 'string' },
 			{ name: 'time', type: 'int' },
 			{ name: 'amount', type: 'float' },
 			{ name: 'amount_is_weight', type: 'int' },
@@ -144,7 +144,7 @@
 
 	$("#type").jqxDropDownList({theme: theme,
 		source: MiscTypeAdapter,
-		valueMember: 'id',
+		valueMember: 'nl',
 		displayMember: 'nl',
 		width: 180,
 		height: 23,
@@ -153,7 +153,7 @@
 	$("#use_use").jqxDropDownList({
 		theme: theme,
 		source: MiscUseAdapter,
-		valueMember: 'id',
+		valueMember: 'nl',
 		displayMember: 'nl',
 		width: 180,
 		height: 23,
@@ -191,8 +191,8 @@
 				editrow = -1;
 				$("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
 				$("#name").val('');
-				$("#type").val(0);
-				$("#use_use").val(0);
+				$("#type").val('Specerij');
+				$("#use_use").val('Starter');
 				$("#time").val(0);
 				$("#amount_is_weight").val(1);
 				$("#use_for").val('');
@@ -212,16 +212,8 @@
 		filtermode: 'excel',
 		columns: [
 			{ text: 'Ingredient naam', datafield: 'name', menu: false },
-			{ text: 'Type', datafield: 'type', align: 'left', width: 120,
-			  cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
-				return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + MiscTypeData[value].nl + "</span>";
-			  }
-		       	},
-			{ text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120,
-			  cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
-				return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + MiscUseData[value].nl + "</span>";
-			  }
-			},
+			{ text: 'Type', datafield: 'type', align: 'left', width: 120 },
+			{ text: 'Gebruik', datafield: 'use_use', align: 'left', width: 120 },
 			{ text: 'Tijd', datafield: 'time', width: 90, align: 'left', menu: false,
 			  cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
 				var duration = "";

mercurial