www/js/inv_yeasts.js

changeset 20
22271f3598ac
parent 14
d9dfd703df83
child 33
2ee6ad5d6f14
equal deleted inserted replaced
19:057a6256bd7b 20:22271f3598ac
51 datafields: [ 51 datafields: [
52 { name: 'record', type: 'number' }, 52 { name: 'record', type: 'number' },
53 { name: 'name', type: 'string' }, 53 { name: 'name', type: 'string' },
54 { name: 'type', type: 'string' }, 54 { name: 'type', type: 'string' },
55 { name: 'form', type: 'string' }, 55 { name: 'form', type: 'string' },
56 { name: 'amount', type: 'float' },
57 { name: 'amount_is_weight', type: 'bool' },
58 { name: 'laboratory', type: 'string' }, 56 { name: 'laboratory', type: 'string' },
59 { name: 'product_id', type: 'string' }, 57 { name: 'product_id', type: 'string' },
60 { name: 'min_temperature', type: 'number' }, 58 { name: 'min_temperature', type: 'number' },
61 { name: 'max_temperature', type: 'number' }, 59 { name: 'max_temperature', type: 'number' },
62 { name: 'flocculation', type: 'string' }, 60 { name: 'flocculation', type: 'string' },
63 { name: 'attenuation', type: 'float' }, 61 { name: 'attenuation', type: 'float' },
64 { name: 'notes', type: 'string' }, 62 { name: 'notes', type: 'string' },
65 { name: 'best_for', type: 'string' }, 63 { name: 'best_for', type: 'string' },
66 { name: 'times_cultured', type: 'number' },
67 { name: 'max_reuse', type: 'number' }, 64 { name: 'max_reuse', type: 'number' },
68 { name: 'add_to_secondary', type: 'bool' },
69 { name: 'inventory', type: 'float' }, 65 { name: 'inventory', type: 'float' },
70 { name: 'cost', type: 'float' }, 66 { name: 'cost', type: 'float' },
71 { name: 'production_date', type: 'string' }, 67 { name: 'production_date', type: 'string' },
72 { name: 'tht_date', type: 'string' } 68 { name: 'tht_date', type: 'string' }
73 ], 69 ],
129 $("#name").jqxInput({ theme: theme, width: 250, height: 23 }); 125 $("#name").jqxInput({ theme: theme, width: 250, height: 23 });
130 $("#laboratory").jqxInput({ theme: theme, width: 150, height: 23 }); 126 $("#laboratory").jqxInput({ theme: theme, width: 150, height: 23 });
131 $("#product_id").jqxInput({ theme: theme, width: 120, height: 23 }); 127 $("#product_id").jqxInput({ theme: theme, width: 120, height: 23 });
132 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 90, height: 23, dropDownHeight: 170 }); 128 $("#type").jqxDropDownList({ theme: theme, source: srcType, width: 90, height: 23, dropDownHeight: 170 });
133 $("#form").jqxDropDownList({ theme: theme, source: srcForm, selectedIndex: 0, width: 90, height: 23, dropDownHeight: 195 }); 129 $("#form").jqxDropDownList({ theme: theme, source: srcForm, selectedIndex: 0, width: 90, height: 23, dropDownHeight: 195 });
134 //$("#amount").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
135 //$("#amount_is_weight").jqxCheckBox({ theme: theme, width: 120, height: 23 });
136
137 $("#notes").jqxInput({ theme: theme, width: 640, height: 120 }); 130 $("#notes").jqxInput({ theme: theme, width: 640, height: 120 });
138 $("#best_for").jqxInput({ theme: theme, width: 640, height: 23 }); 131 $("#best_for").jqxInput({ theme: theme, width: 640, height: 23 });
139 $("#inventory").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true }); 132 $("#inventory").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 1, spinButtons: true });
140 $("#production_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' }); 133 $("#production_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
141 134
142 $("#min_temperature").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 35, decimalDigits: 0, spinButtons: true }); 135 $("#min_temperature").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 35, decimalDigits: 0, spinButtons: true });
143 $("#max_temperature").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 35, decimalDigits: 0, spinButtons: true }); 136 $("#max_temperature").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 35, decimalDigits: 0, spinButtons: true });
144 $("#flocculation").jqxDropDownList({ theme: theme, source: srcFlocculation, width: 90, height: 23, dropDownHeight: 130 }); 137 $("#flocculation").jqxDropDownList({ theme: theme, source: srcFlocculation, width: 90, height: 23, dropDownHeight: 130 });
145 $("#attenuation").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 50, max: 100, decimalDigits: 1, spinButtons: true }); 138 $("#attenuation").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 50, max: 100, decimalDigits: 1, spinButtons: true });
146 139
147 //$("#times_cultured").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 10, decimalDigits: 0, spinButtons: true });
148 $("#max_reuse").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 10, decimalDigits: 0, spinButtons: true }); 140 $("#max_reuse").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, max: 10, decimalDigits: 0, spinButtons: true });
149 //$("#add_to_secondary").jqxCheckBox({ theme: theme, width: 120, height: 23 });
150 $("#cost").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true }); 141 $("#cost").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 70, height: 23, min: 0, decimalDigits: 2, spinButtons: true });
151 $("#tht_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' }); 142 $("#tht_date").jqxDateTimeInput({ theme: theme, width: 100, height: 23, formatString: 'yyyy-MM-dd' });
152 143
153 var dataAdapter = new $.jqx.dataAdapter(source); 144 var dataAdapter = new $.jqx.dataAdapter(source);
154 var editrow = -1; 145 var editrow = -1;
173 $("#name").val(''); 164 $("#name").val('');
174 $("#laboratory").val(''); 165 $("#laboratory").val('');
175 $("#product_id").val(''); 166 $("#product_id").val('');
176 $("#type").val('Ale'); 167 $("#type").val('Ale');
177 $("#form").val('Liquid'); 168 $("#form").val('Liquid');
178 $("#amount").val('0.0');
179 $("#amount_is_weight").val('false');
180 $("#min_temperature").val(''); 169 $("#min_temperature").val('');
181 $("#max_temperature").val(''); 170 $("#max_temperature").val('');
182 $("#flocculation").val('Low'); 171 $("#flocculation").val('Low');
183 $("#attenuation").val('75.0'); 172 $("#attenuation").val('75.0');
184 $("#notes").val(''); 173 $("#notes").val('');
185 $("#best_for").val(''); 174 $("#best_for").val('');
186 $("#times_cultured").val('');
187 $("#max_reuse").val(''); 175 $("#max_reuse").val('');
188 $("#add_to_secondary").val('false');
189 $("#inventory").val(''); 176 $("#inventory").val('');
190 $("#cost").val(''); 177 $("#cost").val('');
191 $("#production_date").val(''); 178 $("#production_date").val('');
192 $("#tht_date").val(''); 179 $("#tht_date").val('');
193 $("#popupWindow").jqxWindow('open'); 180 $("#popupWindow").jqxWindow('open');
214 $("#name").val(dataRecord.name); 201 $("#name").val(dataRecord.name);
215 $("#laboratory").val(dataRecord.laboratory); 202 $("#laboratory").val(dataRecord.laboratory);
216 $("#product_id").val(dataRecord.product_id); 203 $("#product_id").val(dataRecord.product_id);
217 $("#type").val(dataRecord.type); 204 $("#type").val(dataRecord.type);
218 $("#form").val(dataRecord.form); 205 $("#form").val(dataRecord.form);
219 $("#amount").val(dataRecord.amount);
220 $("#amount_is_weight").val(dataRecord.amount_is_weight);
221 $("#min_temperature").val(dataRecord.min_temperature); 206 $("#min_temperature").val(dataRecord.min_temperature);
222 $("#max_temperature").val(dataRecord.max_temperature); 207 $("#max_temperature").val(dataRecord.max_temperature);
223 $("#flocculation").val(dataRecord.flocculation); 208 $("#flocculation").val(dataRecord.flocculation);
224 $("#attenuation").val(dataRecord.attenuation); 209 $("#attenuation").val(dataRecord.attenuation);
225 $("#notes").val(dataRecord.notes); 210 $("#notes").val(dataRecord.notes);
226 $("#best_for").val(dataRecord.best_for); 211 $("#best_for").val(dataRecord.best_for);
227 $("#times_cultured").val(dataRecord.times_cultured);
228 $("#max_reuse").val(dataRecord.max_reuse); 212 $("#max_reuse").val(dataRecord.max_reuse);
229 $("#add_to_secondary").val(dataRecord.add_to_secondary);
230 $("#inventory").val(dataRecord.inventory); 213 $("#inventory").val(dataRecord.inventory);
231 $("#cost").val(dataRecord.cost); 214 $("#cost").val(dataRecord.cost);
232 $("#production_date").val(dataRecord.production_date); 215 $("#production_date").val(dataRecord.production_date);
233 $("#tht_date").val(dataRecord.tht_date); 216 $("#tht_date").val(dataRecord.tht_date);
234 // show the popup window. 217 // show the popup window.
265 var row = { 248 var row = {
266 record: rowID, 249 record: rowID,
267 name: $("#name").val(), 250 name: $("#name").val(),
268 type: $("#type").val(), 251 type: $("#type").val(),
269 form: $("#form").val(), 252 form: $("#form").val(),
270 amount: parseFloat($("#amount").jqxNumberInput('decimal')),
271 amount_is_weight: $("#amount_is_weight").val(),
272 laboratory: $("#laboratory").val(), 253 laboratory: $("#laboratory").val(),
273 product_id: $("#product_id").val(), 254 product_id: $("#product_id").val(),
274 min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), 255 min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')),
275 max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), 256 max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')),
276 flocculation: $("#flocculation").val(), 257 flocculation: $("#flocculation").val(),
277 attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), 258 attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')),
278 notes: $("#notes").val(), 259 notes: $("#notes").val(),
279 best_for: $("#best_for").val(), 260 best_for: $("#best_for").val(),
280 times_recultured: parseInt($("#times_cultured").jqxNumberInput('decimal')),
281 max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), 261 max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')),
282 add_to_secondary: $("#add_to_secondary").val(),
283 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), 262 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
284 cost: parseFloat($("#cost").jqxNumberInput('decimal')), 263 cost: parseFloat($("#cost").jqxNumberInput('decimal')),
285 production_date: $("#production_date").val(), 264 production_date: $("#production_date").val(),
286 tht_date: $("#tht_date").val() 265 tht_date: $("#tht_date").val()
287 }; 266 };
292 var newrow = { 271 var newrow = {
293 record: -1, 272 record: -1,
294 name: $("#name").val(), 273 name: $("#name").val(),
295 type: $("#type").val(), 274 type: $("#type").val(),
296 form: $("#form").val(), 275 form: $("#form").val(),
297 amount: parseFloat($("#amount").jqxNumberInput('decimal')),
298 amount_is_weight: $("#amount_is_weight").val(),
299 laboratory: $("#laboratory").val(), 276 laboratory: $("#laboratory").val(),
300 product_id: $("#product_id").val(), 277 product_id: $("#product_id").val(),
301 min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')), 278 min_temperature: parseInt($("#min_temperature").jqxNumberInput('decimal')),
302 max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')), 279 max_temperature: parseInt($("#max_temperature").jqxNumberInput('decimal')),
303 flocculation: $("#flocculation").val(), 280 flocculation: $("#flocculation").val(),
304 attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')), 281 attenuation: parseFloat($("#attenuation").jqxNumberInput('decimal')),
305 notes: $("#notes").val(), 282 notes: $("#notes").val(),
306 best_for: $("#best_for").val(), 283 best_for: $("#best_for").val(),
307 times_recultured: parseInt($("#times_cultured").jqxNumberInput('decimal')),
308 max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')), 284 max_reuse: parseInt($("#max_reuse").jqxNumberInput('decimal')),
309 add_to_secondary: $("#add_to_secondary").val(),
310 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), 285 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
311 cost: parseFloat($("#cost").jqxNumberInput('decimal')), 286 cost: parseFloat($("#cost").jqxNumberInput('decimal')),
312 production_date: $("#production_date").val(), 287 production_date: $("#production_date").val(),
313 tht_date: $("#tht_date").val() 288 tht_date: $("#tht_date").val()
314 }; 289 };

mercurial