www/js/inv_hops.js

changeset 18
395833e20f88
parent 13
b8c3ca152984
child 19
057a6256bd7b
equal deleted inserted replaced
17:bb97e0de63cf 18:395833e20f88
155 $("#jqxgrid").jqxGrid({ 155 $("#jqxgrid").jqxGrid({
156 width: 1280, 156 width: 1280,
157 height: 630, 157 height: 630,
158 source: dataAdapter, 158 source: dataAdapter,
159 theme: theme, 159 theme: theme,
160 //altrows: true,
161 showstatusbar: true, 160 showstatusbar: true,
162 localization: getLocalization(), 161 localization: getLocalization(),
163 renderstatusbar: function (statusbar) { 162 renderstatusbar: function (statusbar) {
164 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 163 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
165 var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>"); 164 var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");
176 $("#humulene").val(''); 175 $("#humulene").val('');
177 $("#caryophyllene").val(''); 176 $("#caryophyllene").val('');
178 $("#cohumulone").val(''); 177 $("#cohumulone").val('');
179 $("#myrcene").val(''); 178 $("#myrcene").val('');
180 $("#hsi").val(''); 179 $("#hsi").val('');
181 $("#useat").val('Boil'); 180 //$("#useat").val('Boil');
182 $("#type").val('Bittering'); 181 $("#type").val('Bittering');
183 $("#form").val('Pellet'); 182 $("#form").val('Pellet');
184 $("#notes").val(''); 183 $("#notes").val('');
185 $("#origin").val(''); 184 $("#origin").val('');
186 $("#substitutes").val(''); 185 $("#substitutes").val('');
187 $("#always_on_stock").val(''); 186 $("#always_on_stock").val('');
188 $("#inventory").val(''); 187 $("#inventory").val('');
189 $("#cost").val(''); 188 $("#cost").val('');
190 $("#production_date").val(''); 189 $("#production_date").val('');
191 $("#tht_date").val(''); 190 $("#tht_date").val('');
192 $("#supplier_rec").val(''); 191 //$("#supplier_rec").val('');
193 $("#total_oil").val(''); 192 $("#total_oil").val('');
194 $("#popupWindow").jqxWindow('open'); 193 $("#popupWindow").jqxWindow('open');
195 }); 194 });
196 }, 195 },
197 filterable: true, 196 filterable: true,
222 $("#humulene").val(dataRecord.humulene); 221 $("#humulene").val(dataRecord.humulene);
223 $("#caryophyllene").val(dataRecord.caryophyllene); 222 $("#caryophyllene").val(dataRecord.caryophyllene);
224 $("#cohumulone").val(dataRecord.cohumulone); 223 $("#cohumulone").val(dataRecord.cohumulone);
225 $("#myrcene").val(dataRecord.myrcene); 224 $("#myrcene").val(dataRecord.myrcene);
226 $("#hsi").val(dataRecord.hsi); 225 $("#hsi").val(dataRecord.hsi);
227 $("#useat").val(dataRecord.useat); 226 //$("#useat").val(dataRecord.useat);
228 $("#type").val(dataRecord.type); 227 $("#type").val(dataRecord.type);
229 $("#form").val(dataRecord.form); 228 $("#form").val(dataRecord.form);
230 $("#notes").val(dataRecord.notes); 229 $("#notes").val(dataRecord.notes);
231 $("#origin").val(dataRecord.origin); 230 $("#origin").val(dataRecord.origin);
232 $("#substitutes").val(dataRecord.substitutes); 231 $("#substitutes").val(dataRecord.substitutes);
233 $("#always_on_stock").val(dataRecord.always_on_stock); 232 $("#always_on_stock").val(dataRecord.always_on_stock);
234 $("#inventory").val(dataRecord.inventory); 233 $("#inventory").val(dataRecord.inventory);
235 $("#cost").val(dataRecord.cost); 234 $("#cost").val(dataRecord.cost);
236 $("#production_date").val(dataRecord.production_date); 235 $("#production_date").val(dataRecord.production_date);
237 $("#tht_date").val(dataRecord.tht_date); 236 $("#tht_date").val(dataRecord.tht_date);
238 $("#supplier_rec").val(dataRecord.supplier_rec); 237 //$("#supplier_rec").val(dataRecord.supplier_rec);
239 $("#total_oil").val(dataRecord.total_oil); 238 $("#total_oil").val(dataRecord.total_oil);
240 // show the popup window. 239 // show the popup window.
241 $("#popupWindow").jqxWindow('open'); 240 $("#popupWindow").jqxWindow('open');
242 } 241 }
243 } 242 }
276 humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), 275 humulene: parseFloat($("#humulene").jqxNumberInput('decimal')),
277 caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), 276 caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')),
278 cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), 277 cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')),
279 myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), 278 myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')),
280 hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), 279 hsi: parseFloat($("#hsi").jqxNumberInput('decimal')),
281 useat: $("#useat").val(), 280 //useat: $("#useat").val(),
282 type: $("#type").val(), 281 type: $("#type").val(),
283 form: $("#form").val(), 282 form: $("#form").val(),
284 notes: $("#notes").val(), 283 notes: $("#notes").val(),
285 origin: $("#origin").val(), 284 origin: $("#origin").val(),
286 substitutes: $("#substitutes").val(), 285 substitutes: $("#substitutes").val(),
287 always_on_stock: $("#always_on_stock").val(), 286 always_on_stock: $("#always_on_stock").val(),
288 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), 287 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
289 cost: parseFloat($("#cost").jqxNumberInput('decimal')), 288 cost: parseFloat($("#cost").jqxNumberInput('decimal')),
290 production_date: $("#production_date").val(), 289 production_date: $("#production_date").val(),
291 tht_date: $("#tht_date").val(), 290 tht_date: $("#tht_date").val(),
292 supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')), 291 //supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')),
293 total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) 292 total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal'))
294 }; 293 };
295 $('#jqxgrid').jqxGrid('updaterow', rowID, row); 294 $('#jqxgrid').jqxGrid('updaterow', rowID, row);
296 $("#popupWindow").jqxWindow('hide'); 295 $("#popupWindow").jqxWindow('hide');
297 } else { 296 } else {
304 humulene: parseFloat($("#humulene").jqxNumberInput('decimal')), 303 humulene: parseFloat($("#humulene").jqxNumberInput('decimal')),
305 caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')), 304 caryophyllene: parseFloat($("#caryophyllene").jqxNumberInput('decimal')),
306 cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')), 305 cohumulone: parseFloat($("#cohumulone").jqxNumberInput('decimal')),
307 myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')), 306 myrcene: parseFloat($("#myrcene").jqxNumberInput('decimal')),
308 hsi: parseFloat($("#hsi").jqxNumberInput('decimal')), 307 hsi: parseFloat($("#hsi").jqxNumberInput('decimal')),
309 useat: $("#useat").val(), 308 //useat: $("#useat").val(),
310 type: $("#type").val(), 309 type: $("#type").val(),
311 form: $("#form").val(), 310 form: $("#form").val(),
312 notes: $("#notes").val(), 311 notes: $("#notes").val(),
313 origin: $("#origin").val(), 312 origin: $("#origin").val(),
314 substitutes: $("#substitutes").val(), 313 substitutes: $("#substitutes").val(),
315 always_on_stock: $("#always_on_stock").val(), 314 always_on_stock: $("#always_on_stock").val(),
316 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')), 315 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
317 cost: parseFloat($("#cost").jqxNumberInput('decimal')), 316 cost: parseFloat($("#cost").jqxNumberInput('decimal')),
318 production_date: $("#production_date").val(), 317 production_date: $("#production_date").val(),
319 tht_date: $("#tht_date").val(), 318 tht_date: $("#tht_date").val(),
320 supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')), 319 //supplier_rec: parseFloat($("#supplier_rec").jqxNumberInput('decimal')),
321 total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal')) 320 total_oil: parseFloat($("#total_oil").jqxNumberInput('decimal'))
322 }; 321 };
323 $('#jqxgrid').jqxGrid('addrow', null, newrow); 322 $('#jqxgrid').jqxGrid('addrow', null, newrow);
324 $("#popupWindow").jqxWindow('hide'); 323 $("#popupWindow").jqxWindow('hide');
325 } 324 }

mercurial