www/js/inv_fermentables.js

changeset 514
3c680d1dea35
parent 488
77f1617b6994
child 528
202272a28052
equal deleted inserted replaced
513:217ba4596c4d 514:3c680d1dea35
56 datatype: "json", 56 datatype: "json",
57 cache: false, 57 cache: false,
58 datafields: [ 58 datafields: [
59 { name: 'record', type: 'number' }, 59 { name: 'record', type: 'number' },
60 { name: 'name', type: 'string' }, 60 { name: 'name', type: 'string' },
61 { name: 'type', type: 'int' }, 61 { name: 'type', type: 'string' },
62 { name: 'yield', type: 'float' }, 62 { name: 'yield', type: 'float' },
63 { name: 'color', type: 'float' }, 63 { name: 'color', type: 'float' },
64 { name: 'add_after_boil', type: 'int' }, 64 { name: 'add_after_boil', type: 'int' },
65 { name: 'origin', type: 'string' }, 65 { name: 'origin', type: 'string' },
66 { name: 'supplier', type: 'string' }, 66 { name: 'supplier', type: 'string' },
70 { name: 'diastatic_power', type: 'float' }, 70 { name: 'diastatic_power', type: 'float' },
71 { name: 'protein', type: 'float' }, 71 { name: 'protein', type: 'float' },
72 { name: 'dissolved_protein', type: 'float' }, 72 { name: 'dissolved_protein', type: 'float' },
73 { name: 'max_in_batch', type: 'float' }, 73 { name: 'max_in_batch', type: 'float' },
74 { name: 'recommend_mash', type: 'int' }, 74 { name: 'recommend_mash', type: 'int' },
75 { name: 'added', type: 'int' }, 75 { name: 'added', type: 'string' },
76 { name: 'always_on_stock', type: 'int' }, 76 { name: 'always_on_stock', type: 'int' },
77 { name: 'di_ph', type: 'float' }, 77 { name: 'di_ph', type: 'float' },
78 { name: 'acid_to_ph_57', type: 'float' }, 78 { name: 'acid_to_ph_57', type: 'float' },
79 { name: 'graintype', type: 'int' }, 79 { name: 'graintype', type: 'string' },
80 { name: 'inventory', type: 'float' }, 80 { name: 'inventory', type: 'float' },
81 { name: 'cost', type: 'float' }, 81 { name: 'cost', type: 'float' },
82 { name: 'production_date', type: 'string' }, 82 { name: 'production_date', type: 'string' },
83 { name: 'tht_date', type: 'string' } 83 { name: 'tht_date', type: 'string' }
84 ], 84 ],
143 // initialize the input fields. 143 // initialize the input fields.
144 $("#name").jqxInput({ theme: theme, width: 640, height: 23 }); 144 $("#name").jqxInput({ theme: theme, width: 640, height: 23 });
145 $("#type").jqxDropDownList({ 145 $("#type").jqxDropDownList({
146 theme: theme, 146 theme: theme,
147 source: FermentableTypeAdapter, 147 source: FermentableTypeAdapter,
148 valueMember: 'id', 148 valueMember: 'nl',
149 displayMember: 'nl', 149 displayMember: 'nl',
150 width: 180, 150 width: 180,
151 height: 23, 151 height: 23,
152 autoDropDownHeight: true 152 autoDropDownHeight: true
153 }); 153 });
165 $("#max_in_batch").jqxNumberInput( Perc1dec ); 165 $("#max_in_batch").jqxNumberInput( Perc1dec );
166 $("#recommend_mash").jqxCheckBox({ theme: theme, width: 120, height: 23 }); 166 $("#recommend_mash").jqxCheckBox({ theme: theme, width: 120, height: 23 });
167 $("#added").jqxDropDownList({ 167 $("#added").jqxDropDownList({
168 theme: theme, 168 theme: theme,
169 source: AddedAdapter, 169 source: AddedAdapter,
170 valueMember: 'id', 170 valueMember: 'nl',
171 displayMember: 'nl', 171 displayMember: 'nl',
172 width: 180, 172 width: 180,
173 height: 23, 173 height: 23,
174 autoDropDownHeight: true 174 autoDropDownHeight: true
175 }); 175 });
177 $("#di_ph").jqxNumberInput( Spin2pH ); 177 $("#di_ph").jqxNumberInput( Spin2pH );
178 $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 4, spinButtons: true }); 178 $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 4, spinButtons: true });
179 $("#graintype").jqxDropDownList({ 179 $("#graintype").jqxDropDownList({
180 theme: theme, 180 theme: theme,
181 source: GrainTypeAdapter, 181 source: GrainTypeAdapter,
182 valueMember: 'id', 182 valueMember: 'nl',
183 displayMember: 'nl', 183 displayMember: 'nl',
184 width: 180, 184 width: 180,
185 height: 23, 185 height: 23,
186 autoDropDownHeight: true 186 autoDropDownHeight: true
187 }); 187 });
211 // add new row. 211 // add new row.
212 addButton.click(function (event) { 212 addButton.click(function (event) {
213 editrow = -1; 213 editrow = -1;
214 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } }); 214 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
215 $("#name").val('Nieuw product'); 215 $("#name").val('Nieuw product');
216 $("#type").val(0); 216 $("#type").val('Mout');
217 $("#origin").val(''); 217 $("#origin").val('');
218 $("#supplier").val(''); 218 $("#supplier").val('');
219 $("#notes").val(''); 219 $("#notes").val('');
220 $("#yield").val(80); 220 $("#yield").val(80);
221 $("#color").val(3); 221 $("#color").val(3);
227 $("#max_in_batch").val(100); 227 $("#max_in_batch").val(100);
228 $("#recommend_mash").val(1); 228 $("#recommend_mash").val(1);
229 $("#always_on_stock").val(0); 229 $("#always_on_stock").val(0);
230 $("#di_ph").val(0); 230 $("#di_ph").val(0);
231 $("#acid_to_ph_57").val(0); 231 $("#acid_to_ph_57").val(0);
232 $("#graintype").val(0); 232 $("#graintype").val('Basismout');
233 $("#add_after_boil").val(0); 233 $("#add_after_boil").val(0);
234 $("#added").val(0); 234 $("#added").val('Maischen');
235 $("#inventory").val(0); 235 $("#inventory").val(0);
236 $("#cost").val(0); 236 $("#cost").val(0);
237 $("#production_date").val(''); 237 $("#production_date").val('');
238 $("#tht_date").val(''); 238 $("#tht_date").val('');
239 $("#popupWindow").jqxWindow('open'); 239 $("#popupWindow").jqxWindow('open');
246 filtermode: 'excel', 246 filtermode: 'excel',
247 columns: [ 247 columns: [
248 { text: 'Herkomst', datafield: 'origin', width: 150 }, 248 { text: 'Herkomst', datafield: 'origin', width: 150 },
249 { text: 'Producent', datafield: 'supplier', width: 140 }, 249 { text: 'Producent', datafield: 'supplier', width: 140 },
250 { text: 'Vergistbaar product', datafield: 'name', menu: false }, 250 { text: 'Vergistbaar product', datafield: 'name', menu: false },
251 { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type', 251 { text: 'Soort', width: 135, filtertype: 'list', datafield: 'type' },
252 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 252 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125 },
253 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + FermentableTypeData[value].nl + "</span>";
254 }
255 },
256 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125,
257 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
258 return "<span style='margin: 3px; margin-top: 6px; float: left;'>" + GrainTypeData[value].nl + "</span>";
259 }
260 },
261 { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' }, 253 { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' },
262 { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' }, 254 { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' },
263 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false, 255 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false,
264 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { 256 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
265 var amount = ""; 257 var amount = "";

mercurial