www/js/prod_edit.js

changeset 316
82c3bb9a40c2
parent 315
0df8d2db55fb
child 317
454851b335ad
--- a/www/js/prod_edit.js	Mon Mar 04 11:40:33 2019 +0100
+++ b/www/js/prod_edit.js	Mon Mar 04 14:20:48 2019 +0100
@@ -2396,8 +2396,6 @@
 
 	function saveRecord() {
 		console.log("saveRecord()");
-
-		console.log(dataRecord.uuid);
 		var fermentablerow = $('#fermentableGrid').jqxGrid('getrows');
 		var hoprow = $('#hopGrid').jqxGrid('getrows');
 		var miscrow = $('#miscGrid').jqxGrid('getrows');
@@ -2589,10 +2587,13 @@
 			url: url,
 			cache: false,
 			data: data,
+			async: false,
 			type: "POST",
 			success: function (data, status, xhr) {
+				console.log("saveRecord() success");
 			},
 			error: function(jqXHR, textStatus, errorThrown) {
+				console.log("saveRecord() error");
 			}
 		});
 	};
@@ -5338,7 +5339,7 @@
 
 	// Buttons below
 	$("#Print").jqxButton({ template: "info", width: '80px', theme: theme });
-	$("#Print").click(function () {
+	$("#Print").bind('click', function () {
 		saveRecord();
 		// Open print in a new tab.
 		var url="prod_print.php?record=" + my_record;
@@ -5346,7 +5347,7 @@
 	});
 
 	$("#Export").jqxButton({ template: "info", width: '80px', theme: theme });
-	$("#Export").click(function () {
+	$("#Export").bind('click', function () {
 		saveRecord();
 		var url="prod_export.php?record=" + my_record + "&return=" + my_return + "&select=" + my_select +
 			"&code=" + dataRecord.code + "&name=" + dataRecord.name;
@@ -5354,7 +5355,7 @@
 	});
 
 	$("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme });
-	$("#Delete").click(function () {
+	$("#Delete").bind('click', function () {
 		// Open a popup to confirm this action.
 		$('#eventWindow').jqxWindow('open');
 		$("#delOk").click(function () {
@@ -5376,12 +5377,12 @@
 	});
 
 	$("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme });
-	$("#Cancel").click(function () {
+	$("#Cancel").bind('click', function () {
 		window.location.href = my_return;
 	});
 
 	$("#Save").jqxButton({ template: "success", width: '80px', theme: theme });
-	$("#Save").click(function () {
+	$("#Save").bind('click', function () {
 		saveRecord();
 		window.location.href = my_return;
 	});	

mercurial