diff -r 06df1320327c -r 77f1617b6994 www/js/inv_fermentables.js --- a/www/js/inv_fermentables.js Fri Sep 13 16:54:51 2019 +0200 +++ b/www/js/inv_fermentables.js Fri Sep 13 20:24:31 2019 +0200 @@ -44,16 +44,15 @@ $(document).ready(function () { - var dataRecord = {}; - function calcTotal(cost, inventory) { $('#totval').val(cost * inventory); } - var url = "includes/db_inventory_fermentables.php"; + var dataRecord = {}, + url = 'includes/db_inventory_fermentables.php', // prepare the data - var source = { + source = { datatype: "json", cache: false, datafields: [ @@ -95,8 +94,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); @@ -113,6 +112,7 @@ type: "POST", success: function (data, status, xhr) { commit(true); + location.reload( true ); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); @@ -128,15 +128,18 @@ 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); } }); } - }; + }, + dataAdapter = new $.jqx.dataAdapter(source), + editrow = -1; + // initialize the input fields. $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); $("#type").jqxDropDownList({ @@ -188,8 +191,6 @@ $("#tht_date").jqxDateTimeInput( Dateopts ); $("#totval").jqxNumberInput( Show2dec ); - var dataAdapter = new $.jqx.dataAdapter(source); - var editrow = -1; // initialize jqxGrid $("#jqxgrid").jqxGrid({ width: 1280, @@ -198,9 +199,10 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $("
"); - var addButton = $("