www/js/inv_equipments.js

changeset 691
9c21125f584e
parent 645
3b1510050c9b
child 692
dc3311736fb7
--- a/www/js/inv_equipments.js	Sat May 23 20:01:50 2020 +0200
+++ b/www/js/inv_equipments.js	Sat May 23 20:53:48 2020 +0200
@@ -349,6 +349,38 @@
   $('#popupWindow').jqxWindow('hide');
  });
  $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme });
+ $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
+ $('#Clone').click(function() {
+  var row = {
+   record: -1,
+   name: $('#name').val() + ' kopie',
+   boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')),
+   batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')),
+   tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')),
+   tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')),
+   tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')),
+   tun_material: $('#tun_material').val(),
+   tun_height: parseFloat($('#tun_height').jqxNumberInput('decimal')),
+   top_up_water: parseFloat($('#top_up_water').jqxNumberInput('decimal')),
+   trub_chiller_loss: parseFloat($('#trub_chiller_loss').jqxNumberInput('decimal')),
+   evap_rate: parseFloat($('#evap_rate').jqxNumberInput('decimal')),
+   boil_time: parseFloat($('#boil_time').jqxNumberInput('decimal')),
+   calc_boil_volume: $('#calc_boil_volume').val(),
+   top_up_kettle: parseFloat($('#top_up_kettle').jqxNumberInput('decimal')),
+   hop_utilization: parseFloat($('#hop_utilization').jqxNumberInput('decimal')),
+   notes: $('#notes').val(),
+   lauter_volume: parseFloat($('#lauter_volume').jqxNumberInput('decimal')),
+   lauter_height: parseFloat($('#lauter_height').jqxNumberInput('decimal')),
+   lauter_deadspace: parseFloat($('#lauter_deadspace').jqxNumberInput('decimal')),
+   kettle_volume: parseFloat($('#kettle_volume').jqxNumberInput('decimal')),
+   kettle_height: parseFloat($('#kettle_height').jqxNumberInput('decimal')),
+   mash_volume: parseFloat($('#mash_volume').jqxNumberInput('decimal')),
+   mash_max: parseFloat($('#mash_max').jqxNumberInput('decimal')),
+   efficiency: parseFloat($('#efficiency').jqxNumberInput('decimal'))
+  };
+  $('#jqxgrid').jqxGrid('addrow', null, row);
+  $('#popupWindow').jqxWindow('hide');
+ });
  $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme });
  // update the edited row when the user clicks the 'Save' button.
  $('#Save').click(function() {

mercurial