www/js/profile_mash.js

Sat, 14 Sep 2019 19:04:29 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 14 Sep 2019 19:04:29 +0200
changeset 494
af28ebe4a779
parent 483
ac69a63dc23e
child 523
3cccf4392a25
permissions
-rw-r--r--

Fixed as much as possible warnings from the yui-compressor.

23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
286
124af734af68 Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
2 * Copyright (C) 2014-2019
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of BrewCloud
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * BrewCloud is distributed in the hope that it will be useful, but
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 function createDelElements() {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 $('#eventWindow').jqxWindow({
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 theme: theme,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 position: { x: 490, y: 210 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 width: 300,
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
29 height: 175,
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 resizable: false,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 isModal: true,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 modalOpacity: 0.4,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 okButton: $('#delOk'),
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 cancelButton: $('#delCancel'),
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 initContent: function () {
120
b28a3d6143bc Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 45
diff changeset
36 $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
b28a3d6143bc Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 45
diff changeset
37 $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 $('#delCancel').focus();
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 $('#eventWindow').jqxWindow('hide');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 $(document).ready(function () {
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
46
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
47 // tooltips
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
48 $("#name").jqxTooltip({ content: 'De naam voor dit maisch profiel.' });
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
49 $("#notes").jqxTooltip({ content: 'De uitgebreide opmerkingen over dit maisch profiel.' });
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
50
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
51 var steprow = 0,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
52 stepData = {},
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
53 dataRecord = {},
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
54 url = 'includes/db_profile_mash.php',
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
55 source = {
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
56 datatype: 'json',
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 cache: false,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 datafields: [
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 { name: 'record', type: 'number' },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 { name: 'name', type: 'string' },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 { name: 'notes', type: 'string' },
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
62 { name: 'steps', type: 'array' }
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 ],
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 id: 'record',
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 url: url,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 deleterow: function (rowid, commit) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 // synchronize with the server - send delete command
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 var data = "delete=true&" + $.param({ record: rowid });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 $.ajax({
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 dataType: 'json',
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 url: url,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 cache: false,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 data: data,
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
74 type: 'POST',
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 success: function (data, status, xhr) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 commit(true);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
77 console.log('mash deleterow ' + rowid + ' success');
483
ac69a63dc23e Added the reload function in the data save callback code.
Michiel Broek <mbroek@mbse.eu>
parents: 482
diff changeset
78 location.reload( true );
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 error: function (jqXHR, textStatus, errorThrown) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 commit(false);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
82 console.log('mash deleterow ' + textStatus);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 addrow: function (rowid, rowdata, position, commit) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 var data = "insert=true&" + $.param(rowdata);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $.ajax({
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 dataType: 'json',
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 url: url,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 cache: false,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 data: data,
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
93 type: "POST",
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 success: function (data, status, xhr) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 commit(true);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
96 console.log('mash addrow ' + rowid + ' success');
483
ac69a63dc23e Added the reload function in the data save callback code.
Michiel Broek <mbroek@mbse.eu>
parents: 482
diff changeset
97 location.reload( true );
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 error: function(jqXHR, textStatus, errorThrown) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 commit(false);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
101 console.log('mash addrow ' + textStatus);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 updaterow: function (rowid, rowdata, commit) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 var data = "update=true&" + $.param(rowdata);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 $.ajax({
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 dataType: 'json',
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 url: url,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 cache: false,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 data: data,
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
112 type: "POST",
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 success: function (data, status, xhr) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 commit(true);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
115 console.log('mash updaterow ' + rowid + ' success');
483
ac69a63dc23e Added the reload function in the data save callback code.
Michiel Broek <mbroek@mbse.eu>
parents: 482
diff changeset
116 location.reload( true );
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 error: function(jqXHR, textStatus, errorThrown) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 commit(false);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
120 console.log('mash updaterow ' + textStatus);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 }
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
124 },
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
125 dataAdapter = new $.jqx.dataAdapter(source),
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
126 editrow = -1,
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
127
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
128 // Inline steps editor
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
129 editsteps = function (data) {
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
130 var generaterow = function () {
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
131 var row = {};
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
132 row['step_name'] = "Stap 1";
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
133 row['step_type'] = 0;
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
134 row['step_temp'] = 62.0;
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
135 row['step_time'] = 20.0;
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
136 row['ramp_time'] = 1.0;
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
137 row['end_temp'] = 62.0;
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
138 return row;
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
139 },
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
140 stepSource = {
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
141 localdata: data.steps,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
142 datatype: "local",
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
143 datafields: [
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
144 { name: 'step_name', type: 'string' },
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
145 { name: 'step_type', type: 'int' },
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
146 { name: 'step_temp', type: 'float' },
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
147 { name: 'step_time', type: 'float' },
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
148 { name: 'ramp_time', type: 'float' },
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
149 { name: 'end_temp', type: 'float' }
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
150 ],
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
151 addrow: function (rowid, rowdata, position, commit) {
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
152 commit(true);
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
153 },
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
154 deleterow: function (rowid, commit) {
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
155 commit(true);
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
156 }
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
157 },
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
158 stepAdapter = new $.jqx.dataAdapter(stepSource);
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
159
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
160 $("#grid").jqxGrid({
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
161 width: 1020,
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
162 height: 330,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
163 source: stepAdapter,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
164 theme: theme,
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
165 selectionmode: 'singlerow',
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
166 showtoolbar: true,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
167 rendertoolbar: function (toolbar) {
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
168 var container = $("<div style='margin: 5px;'></div>");
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
169 toolbar.append(container);
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
170 container.append('<input style="margin-left: 100px;" id="addrowbutton" type="button" value="Nieuwe stap" />');
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
171 container.append('<input style="margin-left: 450px;" id="deleterowbutton" type="button" value="Verwijder stap" />');
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
172 $("#addrowbutton").jqxButton({ template: "primary", theme: theme, width: 150 });
286
124af734af68 Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
173 $("#deleterowbutton").jqxButton({ template: "danger", theme: theme, width: 150 });
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
174 // create new row.
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
175 $("#addrowbutton").on('click', function () {
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
176 var datarow = generaterow();
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
177 $("#grid").jqxGrid('addrow', null, datarow);
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
178 });
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
179 // delete row.
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
180 $("#deleterowbutton").on('click', function () {
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
181 var rowscount, id, selectedrowindex = $("#grid").jqxGrid('getselectedrowindex');
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
182 rowscount = $("#grid").jqxGrid('getdatainformation').rowscount;
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
183 if (selectedrowindex >= 0 && selectedrowindex < rowscount) {
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
184 id = $("#grid").jqxGrid('getrowid', selectedrowindex);
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
185 $("#grid").jqxGrid('deleterow', id);
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
186 }
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
187 });
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
188 },
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
189 columns: [
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
190 { text: 'Stap naam', datafield: 'step_name' },
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
191 { text: 'Stap type', datafield: 'step_type', width: 150,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
192 cellsrenderer: function (index, datafield, value, defaultvalue, column, rowdata) {
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
193 return "<div style='margin: 4px;'>" + MashStepTypeData[value].nl + "</div>";
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
194 }
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
195 },
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
196 { text: 'Begin &deg;C', datafield: 'step_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
197 { text: 'Eind &deg;C', datafield: 'end_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
286
124af734af68 Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
198 { text: 'Rust min.', datafield: 'step_time', width: 90, align: 'right', cellsalign: 'right' },
124af734af68 Version 0.1.0. Removed localization because it was messy, parts were localized and others not. In production and recipes ingredients not in stock are marked in red.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
199 { text: 'Stap min.', datafield: 'ramp_time', width: 90, align: 'right', cellsalign: 'right' },
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
200 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center',
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
201 cellsrenderer: function () {
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
202 return "Wijzig";
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
203 }, buttonclick: function (row) {
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
204 steprow = row;
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
205 stepData = $("#grid").jqxGrid('getrowdata', steprow);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
206 $("#m_step_name").val(stepData.step_name);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
207 $("#m_step_type").val(stepData.step_type);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
208 $("#m_step_temp").val(stepData.step_temp);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
209 $("#m_end_temp").val(stepData.end_temp);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
210 $("#m_step_time").val(stepData.step_time);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
211 $("#m_ramp_time").val(stepData.ramp_time);
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
212 // show the popup window.
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
213 $("#popupStep").jqxWindow('open');
40
b825c675987d Finished mash steps editing. Style sheets cleanup.
Michiel Broek <mbroek@mbse.eu>
parents: 39
diff changeset
214 }
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
215 }
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
216 ]
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
217 });
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
218 };
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
219
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
220 // Initialize the input fields.
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
221 $("#m_step_name").jqxInput({ theme: theme, width: 320, height: 23 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
222 $("#m_step_type").jqxDropDownList({
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
223 theme: theme,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
224 source: MashStepTypeAdapter,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
225 valueMember: 'id',
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
226 displayMember: 'nl',
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
227 width: 180,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
228 height: 23,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
229 autoDropDownHeight: true
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
230 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
231 $("#m_step_temp").jqxNumberInput( Spin1dec );
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
232 $("#m_step_temp").jqxNumberInput({ Min: 30, Max: 80 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
233 $("#m_end_temp").jqxNumberInput( Spin1dec );
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
234 $("#m_end_temp").jqxNumberInput({ Min: 30, Max: 80 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
235 $("#m_step_time").jqxNumberInput( PosInt );
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
236 $("#m_step_time").jqxNumberInput({ Min: 1, Max: 120 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
237 $("#m_ramp_time").jqxNumberInput( PosInt );
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
238 $("#m_ramp_time").jqxNumberInput({ Min: 1, Max: 30 });
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
239
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 // initialize the input fields.
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
241 $("#name").jqxInput({ theme: theme, width: 480, height: 23 });
120
b28a3d6143bc Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 45
diff changeset
242 $("#notes").jqxInput({ theme: theme, width: 800, height: 100 });
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 // initialize jqxGrid
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 $("#jqxgrid").jqxGrid({
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 width: 1280,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246 height: 630,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 source: dataAdapter,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 theme: theme,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 showstatusbar: true,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 renderstatusbar: function (statusbar) {
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
251 var addButton, container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
252 addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 container.append(addButton);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 statusbar.append(container);
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
255 addButton.jqxButton({ theme: theme, width: 90, height: 20 });
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 // add new row.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257 addButton.click(function (event) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 editrow = -1;
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
259 $("#name").val('Nieuw maisch schema');
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 $("#notes").val('');
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
261 editsteps('');
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 $("#popupWindow").jqxWindow('open');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 },
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 filterable: true,
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 filtermode: 'excel',
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 columns: [
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 { text: 'Maish schema', datafield: 'name', width: 250 },
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
269 { text: 'Opmerkingen', datafield: 'notes' },
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
270 { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button',
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
271 cellsrenderer: function () {
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
272 return "Wijzig";
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 }, buttonclick: function (row) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 editrow = row;
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 // get the clicked row's data and initialize the input fields.
482
ce814c787b79 Fixed not creating new records
Michiel Broek <mbroek@mbse.eu>
parents: 286
diff changeset
276 dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 $("#name").val(dataRecord.name);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 $("#notes").val(dataRecord.notes);
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
279 editsteps(dataRecord);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 // show the popup window.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 $("#popupWindow").jqxWindow('open');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 ]
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 // initialize the popup window and buttons.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $("#popupWindow").jqxWindow({
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
288 width: 1050,
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
289 height: 580,
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
290 position: { x: 110, y: 30 },
38
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
291 resizable: false,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
292 theme: theme,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
293 isModal: true,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
294 autoOpen: false,
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
295 cancelButton: $("#Cancel"),
b7d44c98d609 Initial setup for mash steps editing.
Michiel Broek <mbroek@mbse.eu>
parents: 25
diff changeset
296 modalOpacity: 0.40
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 $("#popupWindow").on('open', function () {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 $("#name").jqxInput('selectAll');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 });
215
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
301 $("#popupStep").jqxWindow({
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
302 width: 800,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
303 height: 300,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
304 position: { x: 230, y: 100 },
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
305 resizable: false,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
306 theme: theme,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
307 isModal: true,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
308 autoOpen: false,
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
309 cancelButton: $("#Ready"),
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
310 modalOpacity: 0.40
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
311 });
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
312
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
313 // step detail popup update values.
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
314 $("#Ready").jqxButton({ template: "success", width: '90px', theme: theme });
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
315 $("#Ready").click(function () {
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
316 $("#grid").jqxGrid('setcellvalue', steprow, 'step_name', $("#m_step_name").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
317 $("#grid").jqxGrid('setcellvalue', steprow, 'step_type', $("#m_step_type").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
318 $("#grid").jqxGrid('setcellvalue', steprow, 'step_temp', $("#m_step_temp").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
319 $("#grid").jqxGrid('setcellvalue', steprow, 'end_temp', $("#m_end_temp").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
320 $("#grid").jqxGrid('setcellvalue', steprow, 'step_time', $("#m_step_time").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
321 $("#grid").jqxGrid('setcellvalue', steprow, 'ramp_time', $("#m_ramp_time").val());
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
322 $('#grid').jqxGrid('sortby', 'step_temp', 'asc');
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
323 });
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
324
83cee005d2d9 Fixed the utf-8 problems when storing json arrays on the server by using manual encoding. The json-encode function sucks for this project. Added step detail edit screen instead of on grid cell editing. This must go into the product and recipe editors too.
Michiel Broek <mbroek@mbse.eu>
parents: 213
diff changeset
325 // mash profile popup.
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
326 $("#Delete").jqxButton({ template: "danger", width: '90px', theme: theme });
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 $("#Delete").click(function () {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 if (editrow >= 0) {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 // Open a popup to confirm this action.
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 $('#eventWindow').jqxWindow('open');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 $("#delOk").click(function () {
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 var rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 $("#jqxgrid").jqxGrid('deleterow', rowID);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 }
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 $("#popupWindow").jqxWindow('hide');
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337 });
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
338 $("#Cancel").jqxButton({ template: "primary", width: '90px', theme: theme });
120
b28a3d6143bc Screen layout changes.
Michiel Broek <mbroek@mbse.eu>
parents: 45
diff changeset
339 $("#Save").jqxButton({ template: "success", width: '90px', theme: theme });
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340 $("#Save").click(function () {
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
341 var steprows = $('#grid').jqxGrid('getrows'),
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
342 rowID = -1,
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
343 row;
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 if (editrow >= 0) {
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
345 rowID = $('#jqxgrid').jqxGrid('getrowid', editrow);
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
346 }
494
af28ebe4a779 Fixed as much as possible warnings from the yui-compressor.
Michiel Broek <mbroek@mbse.eu>
parents: 483
diff changeset
347 row = {
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
348 record: rowID,
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
349 name: $("#name").val(),
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
350 notes: $("#notes").val(),
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
351 steps: steprows
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
352 };
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
353 if (editrow >= 0) {
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 $('#jqxgrid').jqxGrid('updaterow', rowID, row);
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 } else {
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
356 $('#jqxgrid').jqxGrid('addrow', null, row);
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 }
213
b0d484a5525e First step to make profile mash work with indexes and make the edit screen universal.
Michiel Broek <mbroek@mbse.eu>
parents: 120
diff changeset
358 $("#popupWindow").jqxWindow('hide');
23
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 createDelElements();
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 });
4b157d7a1cee Added first part of mash profiles. Steps are in the database but not in the web ui.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362

mercurial