diff -r 06df1320327c -r 77f1617b6994 www/js/inv_miscs.js --- a/www/js/inv_miscs.js Fri Sep 13 16:54:51 2019 +0200 +++ b/www/js/inv_miscs.js Fri Sep 13 20:24:31 2019 +0200 @@ -42,8 +42,6 @@ $(document).ready(function () { - var dataRecord = {}; - function calcTotal(cost, inventory) { $('#totval').val(cost * (inventory / 1000)); @@ -60,9 +58,10 @@ } } - var url = "includes/db_inventory_miscs.php"; + var dataRecord = {}, + url = 'includes/db_inventory_miscs.php', // prepare the data - var source = { + source = { datatype: "json", cache: false, datafields: [ @@ -93,8 +92,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); @@ -111,6 +110,7 @@ type: "POST", success: function (data, status, xhr) { commit(true); + location.reload( true ); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); @@ -126,15 +126,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 }); $("#notes").jqxInput({ theme: theme, width: 800, height: 100 }); @@ -166,8 +169,6 @@ $("#tht_date").jqxDateTimeInput( Dateopts ); $("#totval").jqxNumberInput( Show2dec ); - var dataAdapter = new $.jqx.dataAdapter(source); - var editrow = -1; // initialize jqxGrid $("#jqxgrid").jqxGrid({ width: 1280, @@ -176,9 +177,10 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $("
"); - var addButton = $("