diff -r 8c4f08445624 -r af28ebe4a779 www/js/profile_water.js --- a/www/js/profile_water.js Fri Sep 13 23:02:38 2019 +0200 +++ b/www/js/profile_water.js Sat Sep 14 19:04:29 2019 +0200 @@ -128,7 +128,10 @@ } }); } - }; + }, + 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 }); @@ -141,8 +144,6 @@ $("#ph").jqxNumberInput( Spin2pH ); $("#total_alkalinity").jqxNumberInput( Spin1dec ); - var dataAdapter = new $.jqx.dataAdapter(source), - editrow = -1; // initialize jqxGrid $("#jqxgrid").jqxGrid({ width: 1280, @@ -151,8 +152,8 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $("
"); - var addButton = $("
Nieuw
"); + var container = $("
"), + addButton = $("
Nieuw
"); container.append(addButton); statusbar.append(container); addButton.jqxButton({ theme: theme, width: 90, height: 20 }); @@ -249,11 +250,11 @@ $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); // update the edited row when the user clicks the 'Save' button. $("#Save").click(function () { - var rowID = -1; + var row, rowID = -1; if (editrow >= 0) { rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); } - var row = { + row = { record: rowID, name: $("#name").val(), calcium: parseFloat($("#calcium").jqxNumberInput('decimal')),