www/js/profile_mash.js

changeset 286
124af734af68
parent 245
3649c3d31d15
child 482
ce814c787b79
equal deleted inserted replaced
285:0ea9dfb3fce9 286:124af734af68
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2014-2018 2 * Copyright (C) 2014-2019
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of BrewCloud 6 * This file is part of BrewCloud
7 * 7 *
172 width: 1020, 172 width: 1020,
173 height: 330, 173 height: 330,
174 source: stepAdapter, 174 source: stepAdapter,
175 theme: theme, 175 theme: theme,
176 selectionmode: 'singlerow', 176 selectionmode: 'singlerow',
177 localization: getLocalization(),
178 showtoolbar: true, 177 showtoolbar: true,
179 rendertoolbar: function (toolbar) { 178 rendertoolbar: function (toolbar) {
180 var me = this; 179 var me = this;
181 var container = $("<div style='margin: 5px;'></div>"); 180 var container = $("<div style='margin: 5px;'></div>");
182 toolbar.append(container); 181 toolbar.append(container);
183 container.append('<input style="margin-left: 100px;" id="addrowbutton" type="button" value="Nieuwe stap" />'); 182 container.append('<input style="margin-left: 100px;" id="addrowbutton" type="button" value="Nieuwe stap" />');
184 container.append('<input style="margin-left: 450px;" id="deleterowbutton" type="button" value="Verwijder stap" />'); 183 container.append('<input style="margin-left: 450px;" id="deleterowbutton" type="button" value="Verwijder stap" />');
185 $("#addrowbutton").jqxButton({ template: "primary", theme: theme, width: 150 }); 184 $("#addrowbutton").jqxButton({ template: "primary", theme: theme, width: 150 });
186 $("#deleterowbutton").jqxButton({ template: "primary", theme: theme, width: 150 }); 185 $("#deleterowbutton").jqxButton({ template: "danger", theme: theme, width: 150 });
187 // create new row. 186 // create new row.
188 $("#addrowbutton").on('click', function () { 187 $("#addrowbutton").on('click', function () {
189 var datarow = generaterow(); 188 var datarow = generaterow();
190 var commit = $("#grid").jqxGrid('addrow', null, datarow); 189 var commit = $("#grid").jqxGrid('addrow', null, datarow);
191 }); 190 });
206 return "<div style='margin: 4px;'>" + MashStepTypeData[value].nl + "</div>"; 205 return "<div style='margin: 4px;'>" + MashStepTypeData[value].nl + "</div>";
207 } 206 }
208 }, 207 },
209 { text: 'Begin &deg;C', datafield: 'step_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, 208 { text: 'Begin &deg;C', datafield: 'step_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
210 { text: 'Eind &deg;C', datafield: 'end_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' }, 209 { text: 'Eind &deg;C', datafield: 'end_temp', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
211 { text: 'Rusttijd', datafield: 'step_time', width: 80, align: 'right', cellsalign: 'right' }, 210 { text: 'Rust min.', datafield: 'step_time', width: 90, align: 'right', cellsalign: 'right' },
212 { text: 'Opwarmtijd', datafield: 'ramp_time', width: 80, align: 'right', cellsalign: 'right' }, 211 { text: 'Stap min.', datafield: 'ramp_time', width: 90, align: 'right', cellsalign: 'right' },
213 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () { 212 { text: '', datafield: 'Edit', columntype: 'button', width: 100, align: 'center', cellsrenderer: function () {
214 return "Wijzig"; 213 return "Wijzig";
215 }, buttonclick: function (row) { 214 }, buttonclick: function (row) {
216 steprow = row; 215 steprow = row;
217 stepData = $("#grid").jqxGrid('getrowdata', steprow); 216 stepData = $("#grid").jqxGrid('getrowdata', steprow);
218 $("#m_step_name").val(stepData.step_name); 217 $("#m_step_name").val(stepData.step_name);
238 width: 1280, 237 width: 1280,
239 height: 630, 238 height: 630,
240 source: dataAdapter, 239 source: dataAdapter,
241 theme: theme, 240 theme: theme,
242 showstatusbar: true, 241 showstatusbar: true,
243 localization: getLocalization(),
244 renderstatusbar: function (statusbar) { 242 renderstatusbar: function (statusbar) {
245 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 243 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
246 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;'>Add</span></div>"); 244 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;'>Add</span></div>");
247 container.append(addButton); 245 container.append(addButton);
248 statusbar.append(container); 246 statusbar.append(container);
259 filterable: true, 257 filterable: true,
260 filtermode: 'excel', 258 filtermode: 'excel',
261 columns: [ 259 columns: [
262 { text: 'Maish schema', datafield: 'name', width: 250 }, 260 { text: 'Maish schema', datafield: 'name', width: 250 },
263 { text: 'Opmerkingen', datafield: 'notes' }, 261 { text: 'Opmerkingen', datafield: 'notes' },
264 { text: 'Wijzig', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () { 262 { text: '', datafield: 'Edit', width: 100, align: 'center', columntype: 'button', cellsrenderer: function () {
265 return "Wijzig"; 263 return "Wijzig";
266 }, buttonclick: function (row) { 264 }, buttonclick: function (row) {
267 editrow = row; 265 editrow = row;
268 // get the clicked row's data and initialize the input fields. 266 // get the clicked row's data and initialize the input fields.
269 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); 267 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);

mercurial