306 { text: 'Unit', datafield: 'alias', width: 200 }, |
306 { text: 'Unit', datafield: 'alias', width: 200 }, |
307 { text: 'Mode', datafield: 'mode', width: 120 }, |
307 { text: 'Mode', datafield: 'mode', width: 120 }, |
308 { text: 'Code', datafield: 'product_code', width: 150 }, |
308 { text: 'Code', datafield: 'product_code', width: 150 }, |
309 { text: 'Beer', datafield: 'product_name' }, |
309 { text: 'Beer', datafield: 'product_name' }, |
310 { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function() { |
310 { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function() { |
311 return 'Edit'; |
311 return 'Edit'; |
312 }, buttonclick: function(row) { |
312 }, buttonclick: function(row) { |
313 // open the popup window when the user clicks a button. |
313 // open the popup window when the user clicks a button. |
314 editrow = row; |
314 editrow = row; |
315 $('#popupWindow').jqxWindow({ position: { x: 40, y: 15 } }); |
|
316 dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow); |
315 dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow); |
317 $('#uuid').val(dataRecord.uuid); |
316 if (dataRecord.mode == 'OFF') { |
318 $('#alias').val(dataRecord.alias); |
317 $('#popupWindow').jqxWindow({ position: { x: 40, y: 15 } }); |
319 $('#product_code').val(dataRecord.product_code); |
318 $('#uuid').val(dataRecord.uuid); |
320 $('#product_name').val(dataRecord.product_name); |
319 $('#alias').val(dataRecord.alias); |
321 $('#air_address').val(dataRecord.air_address); |
320 $('#product_code').val(dataRecord.product_code); |
322 $('#air_idx').val(dataRecord.air_idx); |
321 $('#product_name').val(dataRecord.product_name); |
323 $('#beer_address').val(dataRecord.beer_address); |
322 $('#air_address').val(dataRecord.air_address); |
324 $('#beer_address2').val(dataRecord.beer_address2); |
323 $('#air_idx').val(dataRecord.air_idx); |
325 $('#beer_idx').val(dataRecord.beer_idx); |
324 $('#beer_address').val(dataRecord.beer_address); |
326 $('#chiller_address').val(dataRecord.chiller_address); |
325 $('#beer_address2').val(dataRecord.beer_address2); |
327 $('#chiller_idx').val(dataRecord.chiller_idx); |
326 $('#beer_idx').val(dataRecord.beer_idx); |
328 $('#heater_address').val(dataRecord.heater_address); |
327 $('#chiller_address').val(dataRecord.chiller_address); |
329 $('#heater_idx').val(dataRecord.heater_idx); |
328 $('#chiller_idx').val(dataRecord.chiller_idx); |
330 $('#heater_state').val(dataRecord.heater_state); |
329 $('#heater_address').val(dataRecord.heater_address); |
331 $('#heater_delay').val(dataRecord.heater_delay); |
330 $('#heater_idx').val(dataRecord.heater_idx); |
332 $('#cooler_address').val(dataRecord.cooler_address); |
331 $('#heater_state').val(dataRecord.heater_state); |
333 $('#cooler_idx').val(dataRecord.cooler_idx); |
332 $('#heater_delay').val(dataRecord.heater_delay); |
334 $('#cooler_state').val(dataRecord.cooler_state); |
333 $('#cooler_address').val(dataRecord.cooler_address); |
335 $('#cooler_delay').val(dataRecord.cooler_delay); |
334 $('#cooler_idx').val(dataRecord.cooler_idx); |
336 $('#fan_address').val(dataRecord.fan_address); |
335 $('#cooler_state').val(dataRecord.cooler_state); |
337 $('#fan_idx').val(dataRecord.fan_idx); |
336 $('#cooler_delay').val(dataRecord.cooler_delay); |
338 $('#fan_state').val(dataRecord.fan_state); |
337 $('#fan_address').val(dataRecord.fan_address); |
339 $('#fan_delay').val(dataRecord.fan_delay); |
338 $('#fan_idx').val(dataRecord.fan_idx); |
340 $('#light_address').val(dataRecord.light_address); |
339 $('#fan_state').val(dataRecord.fan_state); |
341 $('#light_idx').val(dataRecord.light_idx); |
340 $('#fan_delay').val(dataRecord.fan_delay); |
342 $('#light_state').val(dataRecord.light_state); |
341 $('#light_address').val(dataRecord.light_address); |
343 $('#light_delay').val(dataRecord.light_delay); |
342 $('#light_idx').val(dataRecord.light_idx); |
344 $('#door_address').val(dataRecord.door_address); |
343 $('#light_state').val(dataRecord.light_state); |
345 $('#door_idx').val(dataRecord.door_idx); |
344 $('#light_delay').val(dataRecord.light_delay); |
346 $('#door_state').val(dataRecord.door_state); |
345 $('#door_address').val(dataRecord.door_address); |
347 $('#psu_address').val(dataRecord.psu_address); |
346 $('#door_idx').val(dataRecord.door_idx); |
348 $('#psu_idx').val(dataRecord.psu_idx); |
347 $('#door_state').val(dataRecord.door_state); |
349 $('#psu_state').val(dataRecord.psu_state); |
348 $('#psu_address').val(dataRecord.psu_address); |
350 $('#mode').val(dataRecord.mode); |
349 $('#psu_idx').val(dataRecord.psu_idx); |
351 $('#stage').val(dataRecord.stage); |
350 $('#psu_state').val(dataRecord.psu_state); |
352 $('#pidc_p').val(dataRecord.pidc_p); |
351 $('#mode').val(dataRecord.mode); |
353 $('#pidc_i').val(dataRecord.pidc_i); |
352 $('#stage').val(dataRecord.stage); |
354 $('#pidc_d').val(dataRecord.pidc_d); |
353 $('#pidc_p').val(dataRecord.pidc_p); |
355 $('#pidc_imax').val(dataRecord.pidc_imax); |
354 $('#pidc_i').val(dataRecord.pidc_i); |
356 $('#pidc_idle').val(dataRecord.pidc_idle); |
355 $('#pidc_d').val(dataRecord.pidc_d); |
357 $('#pidh_p').val(dataRecord.pidh_p); |
356 $('#pidc_imax').val(dataRecord.pidc_imax); |
358 $('#pidh_i').val(dataRecord.pidh_i); |
357 $('#pidc_idle').val(dataRecord.pidc_idle); |
359 $('#pidh_d').val(dataRecord.pidh_d); |
358 $('#pidh_p').val(dataRecord.pidh_p); |
360 $('#pidh_imax').val(dataRecord.pidh_imax); |
359 $('#pidh_i').val(dataRecord.pidh_i); |
361 $('#pidh_idle').val(dataRecord.pidh_idle); |
360 $('#pidh_d').val(dataRecord.pidh_d); |
362 |
361 $('#pidh_imax').val(dataRecord.pidh_imax); |
363 // show the popup window. |
362 $('#pidh_idle').val(dataRecord.pidh_idle); |
364 $('#popupWindow').jqxWindow('open'); |
363 // show the popup window. |
|
364 $('#popupWindow').jqxWindow('open'); |
|
365 } else { |
|
366 alert('The fermenter is in use and Edit is not allowed. Stop this fermenter first.'); |
|
367 } |
365 } |
368 } |
366 } |
369 } |
367 ], |
370 ], |
368 }); |
371 }); |
369 |
372 |