www/js/profile_styles.js

changeset 494
af28ebe4a779
parent 486
e17155b3086a
child 522
35675eadc655
--- a/www/js/profile_styles.js	Fri Sep 13 23:02:38 2019 +0200
+++ b/www/js/profile_styles.js	Sat Sep 14 19:04:29 2019 +0200
@@ -128,7 +128,10 @@
 				}
 			});
 		}
-	};
+	},
+	dataAdapter = new $.jqx.dataAdapter(source),
+        editrow = -1;
+
 	// initialize the input fields.
 	$("#name").jqxInput({ theme: theme, width: 320, height: 23 });
 	$("#category").jqxInput({ theme: theme, width: 320, height: 23 });
@@ -169,8 +172,6 @@
 	$("#ingredients").jqxInput({ theme: theme, width: 800, height: 23 });
 	$("#examples").jqxInput({ theme: theme, width: 800, height: 48 });
 
-	var dataAdapter = new $.jqx.dataAdapter(source),
-	editrow = -1;
 	// initialize jqxGrid
 	$("#jqxgrid").jqxGrid({
 		width: 1280,
@@ -302,11 +303,11 @@
 	$("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
 	// update the edited row when the user clicks the 'Save' button.
 	$("#Save").click(function () {
-		var rowID = -1;
+		var row, rowID = -1;
 		if (editrow >= 0) {
 			rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
 		}
-		var row = {
+		row = {
 			record: rowID,
 			name: $("#name").val(),
 			category: $("#category").val(),

mercurial