diff -r fda7286871f2 -r 318aab371497 www/js/profile_fermentation.js --- a/www/js/profile_fermentation.js Sun Jan 27 17:39:53 2019 +0100 +++ b/www/js/profile_fermentation.js Sun Jan 27 20:40:24 2019 +0100 @@ -50,8 +50,6 @@ $("#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.' }); -// $("#fridgemode").jqxTooltip({ content: 'Wanneer deze actief is dan wordt geregeld als koelkast op de lucht temperatuur sensor in plaats van op de bier sensor.' }); - $("#grid").jqxTooltip({ content: 'De maisch stappen in dit profiel.'}); // prepare the data var source = { datatype: "json", @@ -77,6 +75,7 @@ url: url, cache: false, data: data, + type: "POST", success: function (data, status, xhr) { // delete command is executed. commit(true); @@ -93,6 +92,7 @@ url: url, cache: false, data: data, + type: "POST", success: function (data, status, xhr) { commit(true); }, @@ -108,6 +108,7 @@ url: url, cache: false, data: data, + type: "POST", success: function (data, status, xhr) { // update command is executed. commit(true); @@ -166,8 +167,8 @@ toolbar.append(container); container.append(''); container.append(''); - $("#addrowbutton").jqxButton({ theme: theme, width: 150 }); - $("#deleterowbutton").jqxButton({ theme: theme, width: 150 }); + $("#addrowbutton").jqxButton({ template: "primary", theme: theme, width: 150 }); + $("#deleterowbutton").jqxButton({ template: "danger", theme: theme, width: 150 }); // create new row. $("#addrowbutton").on('click', function () { var datarow = generaterow(); @@ -185,7 +186,7 @@ }, columns: [ { text: 'Stap naam', datafield: 'name' }, - { text: 'Min temperatuur', datafield: 'target_lo', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1', + { text: 'Min. °C', datafield: 'target_lo', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1', validation: function (cell, value) { if (value < 0 || value > 40) { return { result: false, message: "De temperatuur moet tussen 0 en 40 zijn." }; @@ -193,7 +194,7 @@ return true; } }, - { text: 'Max temperatuur', datafield: 'target_hi', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1', + { text: 'Max. °C', datafield: 'target_hi', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1', validation: function (cell, value) { if (value < 0 || value > 40) { return { result: false, message: "De temperatuur moet tussen 0 en 40 zijn." }; @@ -220,15 +221,14 @@ } ] }); -// $("#grid").on('cellendedit', function (event) { -// $('#grid').jqxGrid('sortby', 'step_temp', 'asc'); -// }); }; // initialize the input fields. $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); - $("#inittemp_lo").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); - $("#inittemp_hi").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: 0, max: 40, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); + $("#inittemp_lo").jqxNumberInput( Spin1dec5 ); + $("#inittemp_lo").jqxNumberInput({ max: 40 }); + $("#inittemp_hi").jqxNumberInput( Spin1dec5 ); + $("#inittemp_hi").jqxNumberInput({ max: 40 }); $("#fridgemode").jqxCheckBox({ theme: theme, height: 23, enableContainerClick: false }); var editrow = -1; @@ -245,28 +245,26 @@ var addButton = $("
Nieuw
"); container.append(addButton); statusbar.append(container); - addButton.jqxButton({ theme: theme, width: 120, height: 20 }); + addButton.jqxButton({ theme: theme, width: 90, height: 20 }); // add new row. addButton.click(function (event) { editrow = -1; - $("#popupWindow").jqxWindow({ position: { x: 110, y: 40 } }); - $("#name").val(''); + $("#name").val('Nieuw vergist profiel'); dataRecord.uuid = ''; - $("#inittemp_lo").val('20.0'); - $("#inittemp_hi").val('20.0'); - $("#fridgemode").val('0'); + $("#inittemp_lo").val(20.0); + $("#inittemp_hi").val(20.0); + $("#fridgemode").val(0); dataRecord.totalsteps = 0; dataRecord.duration = 0; editsteps(''); $("#popupWindow").jqxWindow('open'); }); }, - filterable: true, - filtermode: 'excel', + filterable: false, columns: [ { text: 'Vergisting profiel', datafield: 'name' }, - { text: 'Min. temperatuur', datafield: 'inittemp_lo', width: 150, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, - { text: 'Max. temperatuur', datafield: 'inittemp_hi', width: 150, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, + { text: 'Min. start °C', datafield: 'inittemp_lo', width: 150, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, + { text: 'Max. start °C', datafield: 'inittemp_hi', width: 150, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, { text: 'Stappen', datafield: 'totalsteps', width: 80, align: 'right', cellsalign: 'right' }, { text: 'Tijdsduur', datafield: 'duration', width: 150, align: 'right', cellsalign: 'right', cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) { @@ -284,12 +282,10 @@ return ""+show+""; } }, - { text: 'Wijzig', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () { + { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { return "Wijzig"; }, buttonclick: function (row) { - // open the popup window when the user clicks a button. editrow = row; - $("#popupWindow").jqxWindow({ position: { x: 110, y: 40 } }); // get the clicked row's data and initialize the input fields. dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); $("#name").val(dataRecord.name); @@ -307,6 +303,7 @@ $("#popupWindow").jqxWindow({ width: 1050, height: 550, + position: { x: 110, y: 30 }, resizable: false, theme: theme, isModal: true,