www/js/rec_main.js

changeset 471
0bf73d605604
parent 286
124af734af68
child 473
5c7566f6d42a
--- a/www/js/rec_main.js	Sat Sep 07 10:47:24 2019 +0200
+++ b/www/js/rec_main.js	Sat Sep 07 19:25:17 2019 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2018
+ * Copyright (C) 2018-2019
  *
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -38,8 +38,9 @@
 		],
 		id: 'record',
 		url: "includes/db_recipes.php"
-	};
-	var dataAdapter = new $.jqx.dataAdapter(source);
+	},
+	dataAdapter = new $.jqx.dataAdapter(source);
+
 	// initialize jqxGrid
 	$("#jqxgrid").jqxGrid({
 		width: 1280,
@@ -49,15 +50,14 @@
 		theme: theme,
 		showstatusbar: true,
 		renderstatusbar: function (statusbar) {
-			var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
-			var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");
+			var addButton, container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
+			addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");
 			container.append(addButton);
 			statusbar.append(container);
 			addButton.jqxButton({ theme: theme, width: 100, height: 20 });
 			// add new recipe.
 			addButton.click(function (event) {
-				var url= "rec_new.php?return=rec_main.php";
-				window.location.href = url;
+				window.location.href = "rec_new.php?return=rec_main.php";
 			});
 		},
 		filterable: true,
@@ -75,8 +75,7 @@
 				return "Wijzig";
 				}, buttonclick: function (row) {
 					var datarecord = dataAdapter.records[row];
-					var url= "rec_edit.php?record=" + datarecord.record + "&return=rec_main.php";
-					window.location.href = url;
+					window.location.href = "rec_edit.php?record=" + datarecord.record + "&return=rec_main.php";
 				}
 			}
 		],

mercurial