www/js/prod_edit.js

changeset 333
2987e5bb830d
parent 332
f0ca77097236
child 335
4a8704b63376
equal deleted inserted replaced
332:f0ca77097236 333:2987e5bb830d
3848 }); 3848 });
3849 }; 3849 };
3850 3850
3851 // inline mash editor 3851 // inline mash editor
3852 var editMash = function (data) { 3852 var editMash = function (data) {
3853 var generaterow = function () {
3854 var row = {};
3855 row["step_name"] = "Stap 1";
3856 row["step_type"] = "Infusion";
3857 row["step_infuse_amount"] = 15;
3858 row["step_temp"] = 62.0;
3859 row['step_time'] = 20.0;
3860 row['ramp_time'] = 1.0;
3861 row['end_temp'] = 62.0;
3862 return row;
3863 }
3864 var mashSource = { 3853 var mashSource = {
3865 localdata: data.mashs, 3854 localdata: data.mashs,
3866 datatype: "local", 3855 datatype: "local",
3867 cache: false, 3856 cache: false,
3868 async: false, 3857 async: false,
3906 toolbar.append(container); 3895 toolbar.append(container);
3907 container.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />'); 3896 container.append('<input style="float: left; margin-left: 165px;" id="saddrowbutton" type="button" value="Nieuwe stap" />');
3908 container.append('<input style="float: left; margin-left: 565px;" id="sdeleterowbutton" type="button" value="Verwijder stap" />'); 3897 container.append('<input style="float: left; margin-left: 565px;" id="sdeleterowbutton" type="button" value="Verwijder stap" />');
3909 $("#saddrowbutton").jqxButton({ template: "primary", theme: theme, height: 27, width: 150, disabled: (dataRecord.stage > 3) }); 3898 $("#saddrowbutton").jqxButton({ template: "primary", theme: theme, height: 27, width: 150, disabled: (dataRecord.stage > 3) });
3910 $("#saddrowbutton").on('click', function () { 3899 $("#saddrowbutton").on('click', function () {
3911 var datarow = generaterow(); 3900 var rowscount = $("#mashGrid").jqxGrid('getdatainformation').rowscount;
3912 var commit = $("#mashGrid").jqxGrid('addrow', null, datarow); 3901 var row = {};
3902 row["step_name"] = "Stap " + (rowscount + 1);
3903 if (rowscount > 0) {
3904 row["step_type"] = 1;
3905 } else {
3906 row["step_type"] = 0;
3907 row["step_infuse_amount"] = 15;
3908 }
3909 row["step_temp"] = 62.0;
3910 row['step_time'] = 20.0;
3911 row['ramp_time'] = 1.0;
3912 row['end_temp'] = 62.0;
3913 var commit = $("#mashGrid").jqxGrid('addrow', null, row);
3913 }); 3914 });
3914 // delete selected step. 3915 // delete selected step.
3915 $("#sdeleterowbutton").jqxButton({ template: "danger", theme: theme, height: 27, width: 150, disabled: (dataRecord.stage > 3) }); 3916 $("#sdeleterowbutton").jqxButton({ template: "danger", theme: theme, height: 27, width: 150, disabled: (dataRecord.stage > 3) });
3916 $("#sdeleterowbutton").on('click', function () { 3917 $("#sdeleterowbutton").on('click', function () {
3917 var selectedrowindex = $("#mashGrid").jqxGrid('getselectedrowindex'); 3918 var selectedrowindex = $("#mashGrid").jqxGrid('getselectedrowindex');

mercurial