diff -r 3cdfcdd71077 -r e17155b3086a www/js/profile_styles.js --- a/www/js/profile_styles.js Fri Sep 13 15:54:23 2019 +0200 +++ b/www/js/profile_styles.js Fri Sep 13 16:15:51 2019 +0200 @@ -44,11 +44,9 @@ $(document).ready(function () { - var dataRecord = {}; - var url = "includes/db_profile_styles.php"; - - // prepare the data - var source = { + var dataRecord = {}, + url = 'includes/db_profile_styles.php', + source = { datatype: "json", cache: false, datafields: [ @@ -88,8 +86,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); @@ -106,6 +104,7 @@ type: "POST", success: function (data, status, xhr) { commit(true); + location.reload( true ); }, error: function(jqXHR, textStatus, errorThrown) { commit(false); @@ -121,8 +120,8 @@ 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); @@ -170,8 +169,8 @@ $("#ingredients").jqxInput({ theme: theme, width: 800, height: 23 }); $("#examples").jqxInput({ theme: theme, width: 800, height: 48 }); - var dataAdapter = new $.jqx.dataAdapter(source); - var editrow = -1; + var dataAdapter = new $.jqx.dataAdapter(source), + editrow = -1; // initialize jqxGrid $("#jqxgrid").jqxGrid({ width: 1280, @@ -180,9 +179,10 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $("
"); - var addButton = $("
Nieuw
"); - var impButton = $("
Import
"); + var container, addButton, impButton; + container = $("
"); + addButton = $("
Nieuw
"); + impButton = $("
Import
"); container.append(addButton); container.append(impButton); statusbar.append(container); @@ -216,8 +216,7 @@ $("#popupWindow").jqxWindow('open'); }); impButton.click(function (event) { - var url="import_ingredients.php?select=styles"; - window.location.href = url; + window.location.href = 'import_ingredients.php?select=styles'; }); }, filterable: true, @@ -244,7 +243,7 @@ // open the popup window when the user clicks a button. editrow = row; // get the clicked row's data and initialize the input fields. - var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); + dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); $("#name").val(dataRecord.name); $("#category").val(dataRecord.category); $("#category_number").val(dataRecord.category_number); @@ -338,7 +337,6 @@ $('#jqxgrid').jqxGrid('addrow', null, row); } $("#popupWindow").jqxWindow('hide'); - location.reload( true ); // reload ourself. }); createDelElements(); });