www/js/inv_fermentables.js

Fri, 25 Jan 2019 16:57:59 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 25 Jan 2019 16:57:59 +0100
changeset 202
64a9c935a66b
parent 199
dad62ec9af18
child 245
3649c3d31d15
permissions
-rw-r--r--

Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.

11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
2 * Copyright (C) 2014-2019
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BrewCloud
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 function createDelElements() {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 $('#eventWindow').jqxWindow({
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 theme: theme,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 position: { x: 490, y: 210 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 width: 300,
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
29 height: 175,
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 resizable: false,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 isModal: true,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 modalOpacity: 0.4,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 okButton: $('#delOk'),
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 cancelButton: $('#delCancel'),
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 initContent: function () {
51
7224109adfe1 More recipe editor changes
Michiel Broek <mbroek@mbse.eu>
parents: 37
diff changeset
36 $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
7224109adfe1 More recipe editor changes
Michiel Broek <mbroek@mbse.eu>
parents: 37
diff changeset
37 $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 $('#delCancel').focus();
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 $('#eventWindow').jqxWindow('hide');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $(document).ready(function () {
199
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
46
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
47 var dataRecord = {};
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
48
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
49 function calcTotal(cost, inventory) {
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
50
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
51 $('#totval').val(cost * inventory);
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
52 }
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
53
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 var url = "includes/db_inventory_fermentables.php";
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 // prepare the data
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 var source = {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 datatype: "json",
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 cache: false,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 datafields: [
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 { name: 'record', type: 'number' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 { name: 'name', type: 'string' },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
62 { name: 'type', type: 'int' },
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 { name: 'yield', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 { name: 'color', type: 'float' },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
65 { name: 'add_after_boil', type: 'int' },
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 { name: 'origin', type: 'string' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 { name: 'supplier', type: 'string' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 { name: 'notes', type: 'string' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 { name: 'coarse_fine_diff', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 { name: 'moisture', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 { name: 'diastatic_power', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 { name: 'protein', type: 'float' },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
73 { name: 'dissolved_protein', type: 'float' },
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 { name: 'max_in_batch', type: 'float' },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
75 { name: 'recommend_mash', type: 'int' },
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
76 { name: 'added', type: 'int' },
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
77 { name: 'always_on_stock', type: 'int' },
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 { name: 'di_ph', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 { name: 'acid_to_ph_57', type: 'float' },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
80 { name: 'graintype', type: 'int' },
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 { name: 'inventory', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 { name: 'cost', type: 'float' },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 { name: 'production_date', type: 'string' },
18
395833e20f88 Better error messages in syslog
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
84 { name: 'tht_date', type: 'string' }
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 ],
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 id: 'record',
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 url: url,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 deleterow: function (rowid, commit) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 // synchronize with the server - send delete command
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 var data = "delete=true&" + $.param({ record: rowid });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 $.ajax({
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 dataType: 'json',
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 url: url,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 cache: false,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 data: data,
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
96 type: "POST",
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 success: function (data, status, xhr) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 // delete command is executed.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 commit(true);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 error: function (jqXHR, textStatus, errorThrown) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 commit(false);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 addrow: function (rowid, rowdata, position, commit) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 var data = "insert=true&" + $.param(rowdata);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 $.ajax({
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 dataType: 'json',
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 url: url,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 cache: false,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 data: data,
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
113 type: "POST",
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 success: function (data, status, xhr) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 commit(true);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 error: function(jqXHR, textStatus, errorThrown) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 commit(false);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 updaterow: function (rowid, rowdata, commit) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 var data = "update=true&" + $.param(rowdata);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 $.ajax({
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 dataType: 'json',
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 url: url,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 cache: false,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 data: data,
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
129 type: "POST",
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 success: function (data, status, xhr) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 // update command is executed.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 commit(true);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 error: function(jqXHR, textStatus, errorThrown) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 commit(false);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 };
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 // initialize the input fields.
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
141 $("#name").jqxInput({ theme: theme, width: 640, height: 23 });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
142 $("#type").jqxDropDownList({
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
143 theme: theme,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
144 source: FermentableTypeAdapter,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
145 valueMember: 'id',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
146 displayMember: 'nl',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
147 width: 180,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
148 height: 23,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
149 autoDropDownHeight: true
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
150 });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
151 $("#yield").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
152 $("#color").jqxNumberInput( Spin1dec5 );
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 $("#add_after_boil").jqxCheckBox({ theme: theme, width: 120, height: 23 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $("#origin").jqxInput({ theme: theme, width: 250, height: 23 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 $("#supplier").jqxInput({ theme: theme, width: 250, height: 23 });
18
395833e20f88 Better error messages in syslog
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
156 $("#notes").jqxInput({ theme: theme, width: 640, height: 100 });
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
157 $("#coarse_fine_diff").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
158 $("#moisture").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
159 $("#diastatic_power").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
160 $("#protein").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
161 $("#dissolved_protein").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
162 $("#max_in_batch").jqxNumberInput( Perc1dec5 );
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 $("#recommend_mash").jqxCheckBox({ theme: theme, width: 120, height: 23 });
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
164 $("#added").jqxDropDownList({
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
165 theme: theme,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
166 source: AddedAdapter,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
167 valueMember: 'id',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
168 displayMember: 'nl',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
169 width: 180,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
170 height: 23,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
171 autoDropDownHeight: true
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
172 });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 $("#always_on_stock").jqxCheckBox({ theme: theme, width: 120, height: 23 });
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
174 $("#di_ph").jqxNumberInput( Spin2pH );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
175 $("#acid_to_ph_57").jqxNumberInput({ inputMode: 'simple', spinMode: 'simple', theme: theme, width: 110, height: 23, min: -1000, max: 1000, decimalDigits: 2, spinButtons: true, spinButtonsStep: 0.01 });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
176 $("#graintype").jqxDropDownList({
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
177 theme: theme,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
178 source: GrainTypeAdapter,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
179 valueMember: 'id',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
180 displayMember: 'nl',
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
181 width: 180,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
182 height: 23,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
183 autoDropDownHeight: true
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
184 });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
185 $("#inventory").jqxNumberInput( Spin1dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
186 $("#production_date").jqxDateTimeInput( Dateopts );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
187 $("#cost").jqxNumberInput( Spin2dec1 );
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
188 $("#tht_date").jqxDateTimeInput( Dateopts );
199
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
189 $("#totval").jqxNumberInput( Spin2dec1 );
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
190 $("#totval").jqxNumberInput({ width: 90, readOnly: true, spinButtons: false });
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
191
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 var dataAdapter = new $.jqx.dataAdapter(source);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 var editrow = -1;
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 // initialize jqxGrid
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 $("#jqxgrid").jqxGrid({
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 width: 1280,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 height: 630,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 source: dataAdapter,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 theme: theme,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 showstatusbar: true,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 localization: getLocalization(),
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 renderstatusbar: function (statusbar) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
204 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;'>Nieuw</span></div>");
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 container.append(addButton);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 statusbar.append(container);
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
207 addButton.jqxButton({ theme: theme, width: 90, height: 20 });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 // add new row.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 addButton.click(function (event) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 editrow = -1;
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
211 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
212 $("#name").val('Nieuw product');
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
213 $("#type").val(0);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 $("#origin").val('');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 $("#supplier").val('');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 $("#notes").val('');
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
217 $("#yield").val(80);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
218 $("#color").val(3);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
219 $("#coarse_fine_diff").val(3);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
220 $("#moisture").val(4);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
221 $("#diastatic_power").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
222 $("#protein").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
223 $("#dissolved_protein").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
224 $("#max_in_batch").val(100);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
225 $("#recommend_mash").val(1);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
226 $("#always_on_stock").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
227 $("#di_ph").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
228 $("#acid_to_ph_57").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
229 $("#graintype").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
230 $("#add_after_boil").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
231 $("#added").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
232 $("#inventory").val(0);
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
233 $("#cost").val(0);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 $("#production_date").val('');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 $("#tht_date").val('');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 $("#popupWindow").jqxWindow('open');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 },
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 filterable: true,
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 filtermode: 'excel',
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 columns: [
202
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
242 { text: 'Herkomst', datafield: 'origin', width: 150 },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
243 { text: 'Producent', datafield: 'supplier', width: 140 },
202
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
244 { text: 'Vergistbaar product', datafield: 'name', menu: false },
197
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
245 { text: 'Soort', width: 135, filtertype: 'list', /*filteritems: FermentableTypeAdapter, displayfield: 'nl',*/ datafield: 'type',
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
246 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
197
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
247 return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[rowdata.type].nl + "</div>";
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
248 },
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
249 // createfilterwidget: function (column, htmlElement, editor) {
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
250 // editor.jqxDropDownList({ displayMember: "nl", valueMember: "id" });
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
251 // }
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
252 // createfilterwidget: function (column, columnElement, widget) {
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
253 // widget.jqxDropDownList({ dropDownWidth: 350 });
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
254 // }
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
255 },
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
256 // { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 135,
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
257 // cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
258 // return "<div style='margin: 4px;' class='jqx-center-align'>" + FermentableTypeData[value].nl + "</div>";
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
259 // },
63174cff2cc1 Failed attempt to get the filterbox right. Saved as a reference.
Michiel Broek <mbroek@mbse.eu>
parents: 195
diff changeset
260 // },
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
261 { text: 'Graan type', datafield: 'graintype', align: 'center', cellsalign: 'center', width: 125,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
262 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
263 return "<div style='margin: 4px;' class='jqx-center-align'>" + GrainTypeData[value].nl + "</div>";
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
264 }
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
265 },
202
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
266 { text: 'EBC', datafield: 'color', width: 60, align: 'right', menu: false, cellsalign: 'right' },
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
267 { text: 'Opbrengst', datafield: 'yield', width: 70, align: 'right', menu: false, cellsalign: 'right', cellsformat: 'p1' },
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
268 { text: 'Voorraad', datafield: 'inventory', width: 100, align: 'right', menu: false,
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
269 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
270 if (value == 0)
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
271 return "<div style='margin: 4px;' class='jqx-right-align'></div>";
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
272 if (value < 1)
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
273 return "<div style='margin: 4px;' class='jqx-right-align'>"+value * 1000+" gr</div>";
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
274 return "<div style='margin: 4px;' class='jqx-right-align'>"+dataAdapter.formatNumber(value,"f1")+" kg</div>";
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
275 }
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
276 },
64a9c935a66b Yeast import Imperial Yeast packs are 200 billion cells/pack. Inventory fermentables the origin country column first. Disable filter menu on some fields. Friendy display of stock inventory.
Michiel Broek <mbroek@mbse.eu>
parents: 199
diff changeset
277 { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', menu: false, columntype: 'button', cellsrenderer: function () {
34
a720353fada9 Formatting and measurements
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
278 return "Wijzig";
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279 }, buttonclick: function (row) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 // open the popup window when the user clicks a button.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 editrow = row;
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
282 $("#popupWindow").jqxWindow({ position: { x: 110, y: 30 } });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 // get the clicked row's data and initialize the input fields.
199
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
284 dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 $("#name").val(dataRecord.name);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 $("#type").val(dataRecord.type);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $("#yield").val(dataRecord.yield);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 $("#color").val(dataRecord.color);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 $("#add_after_boil").val(dataRecord.add_after_boil);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 $("#origin").val(dataRecord.origin);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291 $("#supplier").val(dataRecord.supplier);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 $("#notes").val(dataRecord.notes);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293 $("#coarse_fine_diff").val(dataRecord.coarse_fine_diff);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 $("#moisture").val(dataRecord.moisture);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 $("#diastatic_power").val(dataRecord.diastatic_power);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 $("#protein").val(dataRecord.protein);
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
297 $("#dissolved_protein").val(dataRecord.dissolved_protein);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 $("#max_in_batch").val(dataRecord.max_in_batch);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 $("#recommend_mash").val(dataRecord.recommend_mash);
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
300 $("#added").val(dataRecord.added);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 $("#always_on_stock").val(dataRecord.always_on_stock);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302 $("#di_ph").val(dataRecord.di_ph);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 $("#acid_to_ph_57").val(dataRecord.acid_to_ph_57);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 $("#graintype").val(dataRecord.graintype);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 $("#inventory").val(dataRecord.inventory);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 $("#cost").val(dataRecord.cost);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 $("#production_date").val(dataRecord.production_date);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 $("#tht_date").val(dataRecord.tht_date);
199
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
309 calcTotal(dataRecord.cost, dataRecord.inventory);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 // show the popup window.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 $("#popupWindow").jqxWindow('open');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 ]
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 });
199
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
316
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
317 $("#cost").on('change', function (event) {
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
318 dataRecord.cost = parseFloat(event.args.value);
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
319 calcTotal(dataRecord.cost, dataRecord.inventory);
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
320 });
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
321 $("#inventory").on('change', function (event) {
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
322 dataRecord.inventory = parseFloat(event.args.value);
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
323 calcTotal(dataRecord.cost, dataRecord.inventory);
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
324 });
dad62ec9af18 Added total cost values to the fermenter and hop editor screens.
Michiel Broek <mbroek@mbse.eu>
parents: 197
diff changeset
325
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 // initialize the popup window and buttons.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 $("#popupWindow").jqxWindow({
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
328 width: 1050,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
329 height: 550,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
330 resizable: false,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
331 theme: theme,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
332 isModal: true,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
333 autoOpen: false,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
334 cancelButton: $("#Cancel"),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
335 modalOpacity: 0.40
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337 $("#popupWindow").on('open', function () {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 $("#name").jqxInput('selectAll');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 });
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
340 $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 $("#Delete").click(function () {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
342 if (editrow >= 0) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343 // Open a popup to confirm this action.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 $('#eventWindow').jqxWindow('open');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 $("#delOk").click(function () {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 $("#jqxgrid").jqxGrid('deleterow', rowID);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 }
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 $("#popupWindow").jqxWindow('hide');
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 });
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
352 $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme });
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
353 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 // update the edited row when the user clicks the 'Save' button.
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 $("#Save").click(function () {
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
356 var rowID = -1;
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 if (editrow >= 0) {
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
359 }
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
360 var row = {
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
361 record: rowID,
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
362 name: $("#name").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
363 type: $("#type").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
364 yield: parseFloat($("#yield").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
365 color: parseFloat($("#color").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
366 add_after_boil: $("#add_after_boil").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
367 origin: $("#origin").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
368 supplier: $("#supplier").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
369 notes: $("#notes").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
370 coarse_fine_diff: parseFloat($("#coarse_fine_diff").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
371 moisture: parseFloat($("#moisture").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
372 diastatic_power: parseFloat($("#diastatic_power").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
373 protein: parseFloat($("#protein").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
374 dissolved_protein: parseFloat($("#dissolved_protein").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
375 max_in_batch: parseFloat($("#max_in_batch").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
376 recommend_mash: $("#recommend_mash").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
377 added: $("#added").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
378 always_on_stock: $("#always_on_stock").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
379 di_ph: parseFloat($("#di_ph").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
380 acid_to_ph_57: parseFloat($("#acid_to_ph_57").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
381 graintype: $("#graintype").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
382 inventory: parseFloat($("#inventory").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
383 cost: parseFloat($("#cost").jqxNumberInput('decimal')),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
384 production_date: $("#production_date").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
385 tht_date: $("#tht_date").val(),
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
386 };
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
387 if (editrow >= 0) {
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 $('#jqxgrid').jqxGrid('updaterow', rowID, row);
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 } else {
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
390 $('#jqxgrid').jqxGrid('addrow', null, row);
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 }
195
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
392 $("#popupWindow").jqxWindow('hide');
2ac491548d8d Fermentables database bool to int types. Dropdown lists are using tables with indexes. Dropdown lists display in Dutch. Save and delete in the database now use POST instead of GET. Added the added and dissolved_protein fields. Removed the ibu_gal_per_lb field. Redesigned the web page. Code cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 51
diff changeset
393 location.reload( true ); // reload ourself.
11
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 createDelElements();
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 });
d341f0a91a91 Added fermentable inventory
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397

mercurial