diff -r e17155b3086a -r 06df1320327c www/js/profile_fermentation.js --- a/www/js/profile_fermentation.js Fri Sep 13 16:15:51 2019 +0200 +++ b/www/js/profile_fermentation.js Fri Sep 13 16:54:51 2019 +0200 @@ -44,14 +44,15 @@ $(document).ready(function () { - var dataRecord = {}; - var url = "includes/db_profile_fermentation.php"; // tooltips $("#name").jqxTooltip({ content: 'De naam voor dit vergisting profiel.' }); $("#inittemp_lo").jqxTooltip({ content: 'De minimale begin temperatuur van dit profiel.' }); $("#inittemp_hi").jqxTooltip({ content: 'De maximale begin temperatuur van dit profiel.' }); + + var dataRecord = {}, + url = 'includes/db_profile_fermentation.php', // prepare the data - var source = { + source = { datatype: "json", cache: false, datafields: [ @@ -77,8 +78,8 @@ data: data, type: "POST", success: function (data, status, xhr) { - // delete command is executed. commit(true); + location.reload( true ); }, error: function (jqXHR, textStatus, errorThrown) { commit(false); @@ -95,6 +96,7 @@ type: "POST", success: function (data, status, xhr) { commit(true); + location.reload( true ); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); @@ -110,16 +112,16 @@ data: data, type: "POST", success: function (data, status, xhr) { - // update command is executed. commit(true); + location.reload( true ); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); } }); } - }; - var dataAdapter = new $.jqx.dataAdapter(source); + }, + dataAdapter = new $.jqx.dataAdapter(source); // Inline steps editor var editsteps = function (data) { @@ -150,8 +152,8 @@ deleterow: function (rowid, commit) { commit(true); } - }; - var stepAdapter = new $.jqx.dataAdapter(stepSource); + }, + stepAdapter = new $.jqx.dataAdapter(stepSource); $("#grid").jqxGrid({ width: 800, height: 330, @@ -162,7 +164,6 @@ editable: true, showtoolbar: true, rendertoolbar: function (toolbar) { - var me = this; var container = $("
"); toolbar.append(container); container.append(''); @@ -172,7 +173,7 @@ // create new row. $("#addrowbutton").on('click', function () { var datarow = generaterow(); - var commit = $("#grid").jqxGrid('addrow', null, datarow); + $("#grid").jqxGrid('addrow', null, datarow); }); // delete row. $("#deleterowbutton").on('click', function () { @@ -180,7 +181,7 @@ var rowscount = $("#grid").jqxGrid('getdatainformation').rowscount; if (selectedrowindex >= 0 && selectedrowindex < rowscount) { var id = $("#grid").jqxGrid('getrowid', selectedrowindex); - var commit = $("#grid").jqxGrid('deleterow', id); + $("#grid").jqxGrid('deleterow', id); } }); }, @@ -240,8 +241,8 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $(""); - var addButton = $("