www/js/inv_equipments.js

changeset 785
aa79acfdf8a9
parent 767
08c0343b622b
equal deleted inserted replaced
784:d51b05838ac4 785:aa79acfdf8a9
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2014-2021 2 * Copyright (C) 2014-2022
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of Brewery Management System 6 * This file is part of Brewery Management System
7 * 7 *
90 source = { 90 source = {
91 datatype: 'json', 91 datatype: 'json',
92 cache: false, 92 cache: false,
93 datafields: [ 93 datafields: [
94 { name: 'record', type: 'number' }, 94 { name: 'record', type: 'number' },
95 { name: 'uuid', type: 'string' },
95 { name: 'name', type: 'string' }, 96 { name: 'name', type: 'string' },
96 { name: 'boil_size', type: 'float' }, 97 { name: 'boil_size', type: 'float' },
97 { name: 'batch_size', type: 'float' }, 98 { name: 'batch_size', type: 'float' },
98 { name: 'tun_volume', type: 'float' }, 99 { name: 'tun_volume', type: 'float' },
99 { name: 'tun_weight', type: 'float' }, 100 { name: 'tun_weight', type: 'float' },
253 // add new row. 254 // add new row.
254 addButton.click(function(event) { 255 addButton.click(function(event) {
255 editrow = -1; 256 editrow = -1;
256 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); 257 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
257 $('#name').val('Nieuwe brouwset'); 258 $('#name').val('Nieuwe brouwset');
259 dataRecord.uuid = '';
258 $('#boil_size').val(18); 260 $('#boil_size').val(18);
259 $('#batch_size').val(15.3); 261 $('#batch_size').val(15.3);
260 $('#vol_fermenter').val(14.2); 262 $('#vol_fermenter').val(14.2);
261 $('#tun_volume').val(20); 263 $('#tun_volume').val(20);
262 $('#tun_weight').val(2); 264 $('#tun_weight').val(2);
372 $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme }); 374 $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme });
373 $('#Clone').click(function() { 375 $('#Clone').click(function() {
374 var row = { 376 var row = {
375 record: -1, 377 record: -1,
376 name: $('#name').val() + ' kopie', 378 name: $('#name').val() + ' kopie',
379 uuid: '',
377 boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')), 380 boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')),
378 batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')), 381 batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')),
379 tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')), 382 tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')),
380 tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')), 383 tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')),
381 tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')), 384 tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')),
409 rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); 412 rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
410 } 413 }
411 row = { 414 row = {
412 record: rowID, 415 record: rowID,
413 name: $('#name').val(), 416 name: $('#name').val(),
417 uuid: dataRecord.uuid,
414 boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')), 418 boil_size: parseFloat($('#boil_size').jqxNumberInput('decimal')),
415 batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')), 419 batch_size: parseFloat($('#batch_size').jqxNumberInput('decimal')),
416 tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')), 420 tun_volume: parseFloat($('#tun_volume').jqxNumberInput('decimal')),
417 tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')), 421 tun_weight: parseFloat($('#tun_weight').jqxNumberInput('decimal')),
418 tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')), 422 tun_specific_heat: parseFloat($('#tun_specific_heat').jqxNumberInput('decimal')),

mercurial