166 $("#name").jqxInput({ theme: theme, width: 250, height: 23 }); |
167 $("#name").jqxInput({ theme: theme, width: 250, height: 23 }); |
167 $("#boil_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
168 $("#boil_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
168 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.5 }); |
169 $("#batch_size").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.5 }); |
169 $("#tun_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
170 $("#tun_volume").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.5 }); |
170 $("#tun_weight").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true }); |
171 $("#tun_weight").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true }); |
171 $("#tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 90, height: 23, decimalDigits: 3 }); |
172 $("#tun_specific_heat").jqxNumberInput({ inputMode: 'simple', readOnly: true, theme: theme, width: 70, height: 23, decimalDigits: 3 }); |
172 $("#tun_material").jqxDropDownList({ theme: theme, source: srcMaterial, selectedIndex: 0, width: 110, height: 23, dropDownHeight: 130 }); |
173 $("#tun_material").jqxDropDownList({ theme: theme, source: srcMaterial, selectedIndex: 0, width: 110, height: 23, dropDownHeight: 130 }); |
173 $("#tun_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
174 $("#tun_height").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); |
174 $("#top_up_water").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
175 $("#top_up_water").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
175 $("#trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
176 $("#trub_chiller_loss").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 1, spinButtons: true, spinButtonsStep: 0.1 }); |
176 $("#evap_rate").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 }); |
177 $("#evap_rate").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 90, height: 23, min: 0, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.05 }); |
317 $("#jqxgrid").jqxGrid('deleterow', rowID); |
319 $("#jqxgrid").jqxGrid('deleterow', rowID); |
318 }); |
320 }); |
319 } |
321 } |
320 $("#popupWindow").jqxWindow('hide'); |
322 $("#popupWindow").jqxWindow('hide'); |
321 }); |
323 }); |
322 $("#Cancel").jqxButton({ theme: theme }); |
324 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme }); |
323 $("#Save").jqxButton({ theme: theme }); |
325 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme }); |
324 // update the edited row when the user clicks the 'Save' button. |
326 // update the edited row when the user clicks the 'Save' button. |
325 $("#Save").click(function () { |
327 $("#Save").click(function () { |
|
328 var rowID = -1; |
326 if (editrow >= 0) { |
329 if (editrow >= 0) { |
327 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
330 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
328 var row = { |
331 } |
329 record: rowID, |
332 var row = { |
330 name: $("#name").val(), |
333 record: rowID, |
331 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')), |
334 name: $("#name").val(), |
332 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
335 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')), |
333 tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')), |
336 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
334 tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')), |
337 tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')), |
335 tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')), |
338 tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')), |
336 tun_material: $("#tun_material").val(), |
339 tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')), |
337 tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')), |
340 tun_material: $("#tun_material").val(), |
338 top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')), |
341 tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')), |
339 trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')), |
342 top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')), |
340 evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')), |
343 trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')), |
341 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
344 evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')), |
342 calc_boil_volume: $("#calc_boil_volume").val(), |
345 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
343 top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')), |
346 calc_boil_volume: $("#calc_boil_volume").val(), |
344 hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')), |
347 top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')), |
345 notes: $("#notes").val(), |
348 hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')), |
346 lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')), |
349 notes: $("#notes").val(), |
347 lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')), |
350 lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')), |
348 lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')), |
351 lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')), |
349 kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')), |
352 lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')), |
350 kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')), |
353 kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')), |
351 mash_volume: parseFloat($("#mash_volume").jqxNumberInput('decimal')), |
354 kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')), |
352 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')) |
355 mash_volume: parseFloat($("#mash_volume").jqxNumberInput('decimal')), |
353 }; |
356 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')) |
|
357 }; |
|
358 if (editrow >= 0) { |
354 $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
359 $('#jqxgrid').jqxGrid('updaterow', rowID, row); |
355 $("#popupWindow").jqxWindow('hide'); |
|
356 } else { |
360 } else { |
357 // Insert a record |
361 $('#jqxgrid').jqxGrid('addrow', null, row); |
358 var newrow = { |
362 } |
359 record: -1, |
363 $("#popupWindow").jqxWindow('hide'); |
360 name: $("#name").val(), |
|
361 boil_size: parseFloat($("#boil_size").jqxNumberInput('decimal')), |
|
362 batch_size: parseFloat($("#batch_size").jqxNumberInput('decimal')), |
|
363 tun_volume: parseFloat($("#tun_volume").jqxNumberInput('decimal')), |
|
364 tun_weight: parseFloat($("#tun_weight").jqxNumberInput('decimal')), |
|
365 tun_specific_heat: parseFloat($("#tun_specific_heat").jqxNumberInput('decimal')), |
|
366 tun_material: $("#tun_material").val(), |
|
367 tun_height: parseFloat($("#tun_height").jqxNumberInput('decimal')), |
|
368 top_up_water: parseFloat($("#top_up_water").jqxNumberInput('decimal')), |
|
369 trub_chiller_loss: parseFloat($("#trub_chiller_loss").jqxNumberInput('decimal')), |
|
370 evap_rate: parseFloat($("#evap_rate").jqxNumberInput('decimal')), |
|
371 boil_time: parseFloat($("#boil_time").jqxNumberInput('decimal')), |
|
372 calc_boil_volume: $("#calc_boil_volume").val(), |
|
373 top_up_kettle: parseFloat($("#top_up_kettle").jqxNumberInput('decimal')), |
|
374 hop_utilization: parseFloat($("#hop_utilization").jqxNumberInput('decimal')), |
|
375 notes: $("#notes").val(), |
|
376 lauter_volume: parseFloat($("#lauter_volume").jqxNumberInput('decimal')), |
|
377 lauter_height: parseFloat($("#lauter_height").jqxNumberInput('decimal')), |
|
378 lauter_deadspace: parseFloat($("#lauter_deadspace").jqxNumberInput('decimal')), |
|
379 kettle_volume: parseFloat($("#kettle_volume").jqxNumberInput('decimal')), |
|
380 kettle_height: parseFloat($("#kettle_height").jqxNumberInput('decimal')), |
|
381 mash_volume: parseFloat($("#mash_volume").jqxNumberInput('decimal')), |
|
382 efficiency: parseFloat($("#efficiency").jqxNumberInput('decimal')) |
|
383 }; |
|
384 $('#jqxgrid').jqxGrid('addrow', null, newrow); |
|
385 $("#popupWindow").jqxWindow('hide'); |
|
386 } |
|
387 }); |
364 }); |
388 createDelElements(); |
365 createDelElements(); |
389 }); |
366 }); |
390 |
367 |