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