500 rendertoolbar: function (toolbar) { |
500 rendertoolbar: function (toolbar) { |
501 var me = this; |
501 var me = this; |
502 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
502 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
503 toolbar.append(container); |
503 toolbar.append(container); |
504 container.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>'); |
504 container.append('<div style="float: left; margin-left: 165px;" id="faddrowbutton"></div>'); |
505 container.append('<input style="float: left; margin-left: 505px;" id="fdeleterowbutton" type="button" value="Verwijder mout" />'); |
505 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>'); |
|
506 container.append('<div style="float: left; margin-left: 10px;" id="finstockbutton"></div>'); |
|
507 container.append('<input style="float: left; margin-left: 400px;" id="fdeleterowbutton" type="button" value="Verwijder mout" />'); |
506 // add fermentable from dropdownlist. |
508 // add fermentable from dropdownlist. |
507 $("#faddrowbutton").jqxDropDownList({ |
509 $("#faddrowbutton").jqxDropDownList({ |
508 placeHolder: "Kies mout:", |
510 placeHolder: "Kies mout:", |
509 theme: theme, |
511 theme: theme, |
510 source: fermentablelist, |
512 source: fermentablelist, |
557 row["f_percentage"] = 0; |
559 row["f_percentage"] = 0; |
558 } |
560 } |
559 row["f_di_ph"] = datarecord.di_ph; |
561 row["f_di_ph"] = datarecord.di_ph; |
560 var commit = $("#fermentableGrid").jqxGrid('addrow', null, row); |
562 var commit = $("#fermentableGrid").jqxGrid('addrow', null, row); |
561 } |
563 } |
|
564 }); |
|
565 |
|
566 $("#finstockbutton").jqxCheckBox({ theme: theme, height: 27 }); |
|
567 $("#finstockbutton").on('change', function (event) { |
|
568 fermentableinstock = event.args.checked; |
|
569 fermentablelist.dataBind(); |
562 }); |
570 }); |
563 |
571 |
564 // delete selected fermentable. |
572 // delete selected fermentable. |
565 $("#fdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
573 $("#fdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
566 $("#fdeleterowbutton").on('click', function () { |
574 $("#fdeleterowbutton").on('click', function () { |
800 rendertoolbar: function (toolbar) { |
808 rendertoolbar: function (toolbar) { |
801 var me = this; |
809 var me = this; |
802 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
810 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
803 toolbar.append(container); |
811 toolbar.append(container); |
804 container.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>'); |
812 container.append('<div style="float: left; margin-left: 165px;" id="haddrowbutton"></div>'); |
805 container.append('<input style="float: left; margin-left: 230px;" id="hdeleterowbutton" type="button" value="Verwijder hop" />'); |
813 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>'); |
|
814 container.append('<div style="float: left; margin-left: 10px;" id="hinstockbutton"></div>'); |
|
815 container.append('<input style="float: left; margin-left: 280px;" id="hdeleterowbutton" type="button" value="Verwijder hop" />'); |
806 // add hop from dropdownlist. |
816 // add hop from dropdownlist. |
807 $("#haddrowbutton").jqxDropDownList({ |
817 $("#haddrowbutton").jqxDropDownList({ |
808 placeHolder: "Kies hop:", |
818 placeHolder: "Kies hop:", |
809 theme: theme, |
819 theme: theme, |
810 source: hoplist, |
820 source: hoplist, |
842 row["h_weight"] = 0; |
852 row["h_weight"] = 0; |
843 var commit = $("#hopGrid").jqxGrid('addrow', null, row); |
853 var commit = $("#hopGrid").jqxGrid('addrow', null, row); |
844 } |
854 } |
845 }); |
855 }); |
846 |
856 |
|
857 $("#hinstockbutton").jqxCheckBox({ theme: theme, height: 27 }); |
|
858 $("#hinstockbutton").on('change', function (event) { |
|
859 hopinstock = event.args.checked; |
|
860 hoplist.dataBind(); |
|
861 }); |
|
862 |
847 // delete selected hop. |
863 // delete selected hop. |
848 $("#hdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
864 $("#hdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
849 $("#hdeleterowbutton").on('click', function () { |
865 $("#hdeleterowbutton").on('click', function () { |
850 var selectedrowindex = $("#hopGrid").jqxGrid('getselectedrowindex'); |
866 var selectedrowindex = $("#hopGrid").jqxGrid('getselectedrowindex'); |
851 var rowscount = $("#hopGrid").jqxGrid('getdatainformation').rowscount; |
867 var rowscount = $("#hopGrid").jqxGrid('getdatainformation').rowscount; |
868 }, |
884 }, |
869 { text: 'Type', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_type' }, |
885 { text: 'Type', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_type' }, |
870 { text: 'Vorm', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_form' }, |
886 { text: 'Vorm', editable: false, width: 90, align: 'center', cellsalign: 'center', datafield: 'h_form' }, |
871 { text: 'Alpha', editable: false, datafield: 'h_alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
887 { text: 'Alpha', editable: false, datafield: 'h_alpha', width: 80, align: 'right', cellsalign: 'right', cellsformat: 'p1' }, |
872 { text: 'Amount', hidden: true, datafield: 'h_amount' }, |
888 { text: 'Amount', hidden: true, datafield: 'h_amount' }, |
873 { text: 'Gewicht gr', datafield: 'h_weight', width: 120, align: 'right', cellsalign: 'right', |
889 { text: 'Gewicht gr', datafield: 'h_weight', width: 120, align: 'right', cellsalign: 'right', cellsformat: 'f1', |
874 columntype: 'numberinput', |
890 columntype: 'numberinput', |
875 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
891 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
876 return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(value, "f1") + " gr</div>"; |
892 return "<div style='margin: 4px;' class='jqx-right-align'>" + dataAdapter.formatNumber(value, "f1") + " gr</div>"; |
877 }, |
893 }, |
878 initeditor: function (row, cellvalue, editor, celltext, pressedChar) { |
894 initeditor: function (row, cellvalue, editor, celltext, pressedChar) { |
879 editor.jqxNumberInput({ |
895 editor.jqxNumberInput({ |
880 inputMode: 'simple', |
896 inputMode: 'simple', decimalDigits: 1, min: 0, max: parseFloat(dataRecord.batch_size * 200), |
881 symbol: ' gr', symbolPosition: 'right', |
|
882 decimalDigits: 1, |
|
883 min: 0, max: parseFloat(dataRecord.batch_size * 200), |
|
884 spinButtons: false |
897 spinButtons: false |
885 }); |
898 }); |
886 }, |
899 }, |
887 validation: function (cell, value) { |
900 validation: function (cell, value) { |
888 var maxhops = parseFloat(dataRecord.batch_size) * 200; |
901 var maxhops = parseFloat(dataRecord.batch_size) * 200; |
1006 rendertoolbar: function (toolbar) { |
1019 rendertoolbar: function (toolbar) { |
1007 var me = this; |
1020 var me = this; |
1008 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1021 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1009 toolbar.append(container); |
1022 toolbar.append(container); |
1010 container.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>'); |
1023 container.append('<div style="float: left; margin-left: 165px;" id="maddrowbutton"></div>'); |
1011 container.append('<input style="float: left; margin-left: 230px;" id="mdeleterowbutton" type="button" value="Verwijder ingredient" />'); |
1024 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>'); |
|
1025 container.append('<div style="float: left; margin-left: 10px;" id="minstockbutton"></div>'); |
|
1026 container.append('<input style="float: left; margin-left: 200px;" id="mdeleterowbutton" type="button" value="Verwijder ingredient" />'); |
1012 // add misc from dropdownlist. |
1027 // add misc from dropdownlist. |
1013 $("#maddrowbutton").jqxDropDownList({ |
1028 $("#maddrowbutton").jqxDropDownList({ |
1014 placeHolder: "Kies ingredient:", |
1029 placeHolder: "Kies ingredient:", |
1015 theme: theme, |
1030 theme: theme, |
1016 source: misclist, |
1031 source: misclist, |
1017 displayMember: "name", |
1032 displayMember: "name", |
1018 width: 150, |
1033 width: 150, |
1019 height: 27, |
1034 height: 27, |
1020 dropDownWidth: 300 |
1035 dropDownWidth: 500, |
|
1036 dropDownHeight: 500 |
1021 }); |
1037 }); |
1022 $("#maddrowbutton").on('select', function (event) { |
1038 $("#maddrowbutton").on('select', function (event) { |
1023 if (event.args) { |
1039 if (event.args) { |
1024 var index = event.args.index; |
1040 var index = event.args.index; |
1025 var datarecord = misclist.records[index]; |
1041 var datarecord = misclist.records[index]; |
1033 row["m_weight"] = 0; |
1049 row["m_weight"] = 0; |
1034 row["m_amount_is_weight"] = datarecord.amount_is_weight; |
1050 row["m_amount_is_weight"] = datarecord.amount_is_weight; |
1035 var commit = $("#miscGrid").jqxGrid('addrow', null, row); |
1051 var commit = $("#miscGrid").jqxGrid('addrow', null, row); |
1036 } |
1052 } |
1037 }); |
1053 }); |
|
1054 $("#minstockbutton").jqxCheckBox({ theme: theme, height: 27 }); |
|
1055 $("#minstockbutton").on('change', function (event) { |
|
1056 miscinstock = event.args.checked; |
|
1057 misclist.dataBind(); |
|
1058 }); |
1038 // delete selected misc. |
1059 // delete selected misc. |
1039 $("#mdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1060 $("#mdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1040 $("#mdeleterowbutton").on('click', function () { |
1061 $("#mdeleterowbutton").on('click', function () { |
1041 var selectedrowindex = $("#miscGrid").jqxGrid('getselectedrowindex'); |
1062 var selectedrowindex = $("#miscGrid").jqxGrid('getselectedrowindex'); |
1042 var rowscount = $("#miscGrid").jqxGrid('getdatainformation').rowscount; |
1063 var rowscount = $("#miscGrid").jqxGrid('getdatainformation').rowscount; |
1148 { name: 'y_time', type: 'float' }, |
1169 { name: 'y_time', type: 'float' }, |
1149 { name: 'y_min_temperature', type: 'float' }, |
1170 { name: 'y_min_temperature', type: 'float' }, |
1150 { name: 'y_max_temperature', type: 'float' }, |
1171 { name: 'y_max_temperature', type: 'float' }, |
1151 { name: 'y_attenuation', type: 'float' }, |
1172 { name: 'y_attenuation', type: 'float' }, |
1152 { name: 'y_amount_is_weight', type: 'bool' }, |
1173 { name: 'y_amount_is_weight', type: 'bool' }, |
1153 { name: 'y_use', type: 'string' } |
1174 { name: 'y_use', type: 'string' }, |
|
1175 { name: 'y_weight', type: 'float' } |
1154 ], |
1176 ], |
1155 addrow: function (rowid, rowdata, position, commit) { |
1177 addrow: function (rowid, rowdata, position, commit) { |
1156 commit(true); |
1178 commit(true); |
1157 }, |
1179 }, |
1158 deleterow: function (rowid, commit) { |
1180 deleterow: function (rowid, commit) { |
1159 commit(true); |
1181 commit(true); |
1160 } |
1182 } |
1161 }; |
1183 }; |
1162 var yeastAdapter = new $.jqx.dataAdapter(yeastSource); |
1184 var yeastAdapter = new $.jqx.dataAdapter(yeastSource, { |
|
1185 beforeLoadComplete: function (records) { |
|
1186 var data = new Array(); |
|
1187 for (var i = 0; i < records.length; i++) { |
|
1188 var row = records[i]; |
|
1189 if (row.y_form == 'Liquid') |
|
1190 row.y_weight = Math.round(row.y_amount * 17); |
|
1191 else |
|
1192 row.y_weight = row.y_amount * 1000; |
|
1193 data.push(row); |
|
1194 } |
|
1195 return data; |
|
1196 }, |
|
1197 loadError: function(jqXHR, status, error) { |
|
1198 $('#err').text(status + ' ' + error); |
|
1199 }, |
|
1200 }); |
1163 $("#yeastGrid").jqxGrid({ |
1201 $("#yeastGrid").jqxGrid({ |
1164 width: 1050, |
1202 width: 1050, |
1165 height: 300, |
1203 height: 300, |
1166 source: yeastAdapter, |
1204 source: yeastAdapter, |
1167 theme: theme, |
1205 theme: theme, |
1173 rendertoolbar: function (toolbar) { |
1211 rendertoolbar: function (toolbar) { |
1174 var me = this; |
1212 var me = this; |
1175 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1213 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1176 toolbar.append(container); |
1214 toolbar.append(container); |
1177 container.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>'); |
1215 container.append('<div style="float: left; margin-left: 165px;" id="yaddrowbutton"></div>'); |
|
1216 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>'); |
|
1217 container.append('<div style="float: left; margin-left: 10px;" id="yinstockbutton"></div>'); |
1178 container.append('<input style="float: left; margin-left: 230px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />'); |
1218 container.append('<input style="float: left; margin-left: 230px;" id="ydeleterowbutton" type="button" value="Verwijder gist" />'); |
1179 // add yeast from dropdownlist. |
1219 // add yeast from dropdownlist. |
1180 $("#yaddrowbutton").jqxDropDownList({ |
1220 $("#yaddrowbutton").jqxDropDownList({ |
1181 placeHolder: "Kies gist:", |
1221 placeHolder: "Kies gist:", |
1182 theme: theme, |
1222 theme: theme, |
1211 row["y_amount_is_weight"] = 0; |
1251 row["y_amount_is_weight"] = 0; |
1212 } |
1252 } |
1213 row["y_min_temperature"] = datarecord.min_temperature; |
1253 row["y_min_temperature"] = datarecord.min_temperature; |
1214 row["y_max_temperature"] = datarecord.max_temperature; |
1254 row["y_max_temperature"] = datarecord.max_temperature; |
1215 row["y_attenuation"] = datarecord.attenuation; |
1255 row["y_attenuation"] = datarecord.attenuation; |
|
1256 row["y_weight"] = 0; |
1216 var commit = $("#yeastGrid").jqxGrid('addrow', null, row); |
1257 var commit = $("#yeastGrid").jqxGrid('addrow', null, row); |
1217 } |
1258 } |
1218 }); |
1259 }); |
|
1260 $("#yinstockbutton").jqxCheckBox({ theme: theme, height: 27 }); |
|
1261 $("#yinstockbutton").on('change', function (event) { |
|
1262 yeastinstock = event.args.checked; |
|
1263 yeastlist.dataBind(); |
|
1264 }); |
1219 // delete selected yeast. |
1265 // delete selected yeast. |
1220 $("#ydeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1266 $("#ydeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1221 $("#ydeleterowbutton").on('click', function () { |
1267 $("#ydeleterowbutton").on('click', function () { |
1222 var selectedrowindex = $("#yeastGrid").jqxGrid('getselectedrowindex'); |
1268 var selectedrowindex = $("#yeastGrid").jqxGrid('getselectedrowindex'); |
1223 var rowscount = $("#yeastGrid").jqxGrid('getdatainformation').rowscount; |
1269 var rowscount = $("#yeastGrid").jqxGrid('getdatainformation').rowscount; |
1244 var srcYUse = [ "Primary", "Secondary", "Bottle" ]; |
1290 var srcYUse = [ "Primary", "Secondary", "Bottle" ]; |
1245 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcYUse }); |
1291 editor.jqxDropDownList({ autoDropDownHeight: true, source: srcYUse }); |
1246 } |
1292 } |
1247 }, |
1293 }, |
1248 { datafield: 'y_amount', width: 90 }, |
1294 { datafield: 'y_amount', width: 90 }, |
1249 { text: 'Hoeveel', datafield: 'amount', width: 110, align: 'right', cellsalign: 'right', columntype: 'numberinput', |
1295 { text: 'Hoeveel', datafield: 'y_weight', width: 110, align: 'right', cellsalign: 'right', |
|
1296 cellsformat: 'f1', columntype: 'numberinput', |
1250 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
1297 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) { |
1251 if (rowdata.y_form == 'Liquid') { |
1298 if (rowdata.y_form == 'Liquid') { |
1252 var hoeveel = rowdata.y_amount * 17; |
1299 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" pk</div>"; |
1253 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(hoeveel, "f0")+" pk</div>"; |
|
1254 } else if (rowdata.y_form == 'Dry') { |
1300 } else if (rowdata.y_form == 'Dry') { |
1255 var hoeveel = rowdata.y_amount * 1000; |
1301 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f1")+" gr</div>"; |
1256 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(hoeveel, "f1")+" gr</div>"; |
|
1257 } else { |
1302 } else { |
1258 var hoeveel = rowdata.y_amount * 1000; |
1303 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value, "f0")+" ml</div>"; |
1259 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(hoeveel, "f0")+" ml</div>"; |
|
1260 } |
1304 } |
1261 }, |
1305 }, |
1262 initeditor: function (row, cellvalue, editor, celltext, pressedChar) { |
1306 initeditor: function (row, cellvalue, editor, celltext, pressedChar) { |
1263 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form'); |
1307 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form'); |
1264 if (form == 'Liquid') { |
1308 if (form == 'Dry') { |
1265 editor.jqxNumberInput({ decimalDigits: 0, min: 0 }); |
1309 editor.jqxNumberInput({ decimalDigits: 1, min: 0, spinButtons: false }); |
1266 } else { |
1310 } else { |
1267 editor.jqxNumberInput({ decimalDigits: 1, min: 0 }); |
1311 editor.jqxNumberInput({ decimalDigits: 0, min: 0, spinButtons: false }); |
1268 } |
1312 } |
1269 }, |
1313 }, |
1270 validation: function (cell, value) { |
1314 validation: function (cell, value) { |
1271 if (value < 0 || value > 100000000000 ) { |
1315 if (value < 0 || value > 100000000000 ) { |
1272 return { result: false, message: "Volume moet 0-~ zijn" }; |
1316 return { result: false, message: "Hoeveelheid moet 0-~ zijn" }; |
1273 } |
1317 } |
1274 return true; |
1318 return true; |
1275 } |
1319 } |
1276 } |
1320 } |
1277 ] |
1321 ] |
1278 }); |
1322 }); |
1279 $("#yeastGrid").on('cellendedit', function (event) { |
1323 $("#yeastGrid").on('cellendedit', function (event) { |
1280 var args = event.args; |
1324 var args = event.args; |
1281 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value); |
1325 console.log("Event Type: cellendedit, Column: " + args.datafield + ", Row: " + (args.rowindex) + ", Value: " + args.value); |
1282 if (args.datafield == 'amount') { |
1326 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value); |
|
1327 if (args.datafield == 'y_weight') { |
1283 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form'); |
1328 var form = $("#yeastGrid").jqxGrid('getcellvalue', args.rowindex, 'y_form'); |
1284 if (form == 'Liquid') |
1329 if (form == 'Liquid') |
1285 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value * 0.0588)); |
1330 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value * 0.0588)); |
1286 else |
1331 else |
1287 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value / 1000)); |
1332 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, 'y_amount', parseFloat(args.value / 1000)); |
1288 } else { |
|
1289 $("#yeastGrid").jqxGrid('setcellvalue', args.rowindex, args.datafield, args.value); |
|
1290 } |
1333 } |
1291 }); |
1334 }); |
1292 }; |
1335 }; |
1293 |
1336 |
1294 // Inline waters editor |
1337 // Inline waters editor |
1329 rendertoolbar: function (toolbar) { |
1372 rendertoolbar: function (toolbar) { |
1330 var me = this; |
1373 var me = this; |
1331 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1374 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); |
1332 toolbar.append(container); |
1375 toolbar.append(container); |
1333 container.append('<div style="float: left; margin-left: 165px;" id="waddrowbutton"></div>'); |
1376 container.append('<div style="float: left; margin-left: 165px;" id="waddrowbutton"></div>'); |
1334 container.append('<input style="float: left; margin-left: 230px;" id="wdeleterowbutton" type="button" value="Verwijder water" />'); |
1377 container.append('<div style="float: left; margin-left: 10px; margin-top: 5px;">In voorraad:</div>'); |
|
1378 container.append('<div style="float: left; margin-left: 10px;" id="winstockbutton"></div>'); |
|
1379 container.append('<input style="float: left; margin-left: 200px;" id="wdeleterowbutton" type="button" value="Verwijder water" />'); |
1335 // add water from dropdownlist. |
1380 // add water from dropdownlist. |
1336 $("#waddrowbutton").jqxDropDownList({ |
1381 $("#waddrowbutton").jqxDropDownList({ |
1337 placeHolder: "Kies water:", |
1382 placeHolder: "Kies water:", |
1338 theme: theme, |
1383 theme: theme, |
1339 source: waterlist, |
1384 source: waterlist, |
1340 displayMember: "name", |
1385 displayMember: "name", |
1341 width: 150, |
1386 width: 150, |
1342 height: 27, |
1387 height: 27, |
1343 dropDownWidth: 300 |
1388 dropDownWidth: 400, |
|
1389 dropDownHeight: 400 |
1344 }); |
1390 }); |
1345 $("#waddrowbutton").on('select', function (event) { |
1391 $("#waddrowbutton").on('select', function (event) { |
1346 if (event.args) { |
1392 if (event.args) { |
1347 var index = event.args.index; |
1393 var index = event.args.index; |
1348 var datarecord = waterlist.records[index]; |
1394 var datarecord = waterlist.records[index]; |
1358 row["w_total_alkalinity"] = datarecord.total_alkalinity; |
1404 row["w_total_alkalinity"] = datarecord.total_alkalinity; |
1359 row["w_cost"] = datarecord.cost; |
1405 row["w_cost"] = datarecord.cost; |
1360 var commit = $("#waterGrid").jqxGrid('addrow', null, row); |
1406 var commit = $("#waterGrid").jqxGrid('addrow', null, row); |
1361 } |
1407 } |
1362 }); |
1408 }); |
1363 |
1409 $("#winstockbutton").jqxCheckBox({ theme: theme, height: 27 }); |
|
1410 $("#winstockbutton").on('change', function (event) { |
|
1411 waterinstock = event.args.checked; |
|
1412 waterlist.dataBind(); |
|
1413 }); |
1364 // delete selected water. |
1414 // delete selected water. |
1365 // Overgebleven waters in volume verhogen met het verwijderde water. |
1415 // Overgebleven waters in volume verhogen met het verwijderde water. |
1366 $("#wdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1416 $("#wdeleterowbutton").jqxButton({ theme: theme, height: 27, width: 150 }); |
1367 $("#wdeleterowbutton").on('click', function () { |
1417 $("#wdeleterowbutton").on('click', function () { |
1368 var selectedrowindex = $("#waterGrid").jqxGrid('getselectedrowindex'); |
1418 var selectedrowindex = $("#waterGrid").jqxGrid('getselectedrowindex'); |