www/js/inv_equipments.js

changeset 34
a720353fada9
parent 27
d702a41a7021
child 116
ac993ef43b13
equal deleted inserted replaced
33:2ee6ad5d6f14 34:a720353fada9
24 function createDelElements() { 24 function createDelElements() {
25 $('#eventWindow').jqxWindow({ 25 $('#eventWindow').jqxWindow({
26 theme: theme, 26 theme: theme,
27 position: { x: 490, y: 210 }, 27 position: { x: 490, y: 210 },
28 width: 300, 28 width: 300,
29 height: 145, 29 height: 175,
30 resizable: false, 30 resizable: false,
31 isModal: true, 31 isModal: true,
32 modalOpacity: 0.4, 32 modalOpacity: 0.4,
33 okButton: $('#delOk'), 33 okButton: $('#delOk'),
34 cancelButton: $('#delCancel'), 34 cancelButton: $('#delCancel'),
177 theme: theme, 177 theme: theme,
178 showstatusbar: true, 178 showstatusbar: true,
179 localization: getLocalization(), 179 localization: getLocalization(),
180 renderstatusbar: function (statusbar) { 180 renderstatusbar: function (statusbar) {
181 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 181 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
182 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>"); 182 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>");
183 container.append(addButton); 183 container.append(addButton);
184 statusbar.append(container); 184 statusbar.append(container);
185 addButton.jqxButton({ width: 60, height: 20 }); 185 addButton.jqxButton({ theme: theme, width: 120, height: 20 });
186 // add new row. 186 // add new row.
187 addButton.click(function (event) { 187 addButton.click(function (event) {
188 editrow = -1; 188 editrow = -1;
189 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); 189 $("#popupWindow").jqxWindow({ position: { x: 180, y: 30 } });
190 $("#name").val(''); 190 $("#name").val('');
191 $("#boil_size").val('18'); 191 $("#boil_size").val('18');
192 $("#batch_size").val('15.3'); 192 $("#batch_size").val('15.3');
193 $("#tun_volume").val('20'); 193 $("#tun_volume").val('20');
194 $("#tun_weight").val('2'); 194 $("#tun_weight").val('2');
211 }); 211 });
212 }, 212 },
213 filterable: true, 213 filterable: true,
214 filtermode: 'excel', 214 filtermode: 'excel',
215 columns: [ 215 columns: [
216 { text: 'Equipment Name', datafield: 'name', width: 250 }, 216 { text: 'Installatie naam', datafield: 'name', width: 200 },
217 { text: 'Boil Size', datafield: 'boil_size', width: 90, cellsalign: 'right', cellsformat: 'f1' }, 217 { text: 'Kook volume', datafield: 'boil_size', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
218 { text: 'Batch Size', datafield: 'batch_size', width: 90, cellsalign: 'right', cellsformat: 'f1' }, 218 { text: 'Batch volume', datafield: 'batch_size', width: 100, align: 'right', cellsalign: 'right', cellsformat: 'f1' },
219 { text: 'Notes', datafield: 'notes' }, 219 { text: 'Opmerkingen', datafield: 'notes' },
220 { text: 'Edit', datafield: 'Edit', width: 80, columntype: 'button', cellsrenderer: function () { 220 { text: 'Wijzig', datafield: 'Edit', width: 120, align: 'center', columntype: 'button', cellsrenderer: function () {
221 return "Edit"; 221 return "Wijzig";
222 }, buttonclick: function (row) { 222 }, buttonclick: function (row) {
223 // open the popup window when the user clicks a button. 223 // open the popup window when the user clicks a button.
224 editrow = row; 224 editrow = row;
225 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); 225 $("#popupWindow").jqxWindow({ position: { x: 180, y: 30 } });
226 // get the clicked row's data and initialize the input fields. 226 // get the clicked row's data and initialize the input fields.
227 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow); 227 var dataRecord = $("#jqxgrid").jqxGrid('getrowdata', editrow);
228 $("#name").val(dataRecord.name); 228 $("#name").val(dataRecord.name);
229 $("#boil_size").val(dataRecord.boil_size); 229 $("#boil_size").val(dataRecord.boil_size);
230 $("#batch_size").val(dataRecord.batch_size); 230 $("#batch_size").val(dataRecord.batch_size);
251 } 251 }
252 ] 252 ]
253 }); 253 });
254 // initialize the popup window and buttons. 254 // initialize the popup window and buttons.
255 $("#popupWindow").jqxWindow({ 255 $("#popupWindow").jqxWindow({
256 width: 800, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.40 256 width: 900, resizable: false, theme: theme, isModal: true, autoOpen: false, cancelButton: $("#Cancel"), modalOpacity: 0.40
257 }); 257 });
258 $("#popupWindow").on('open', function () { 258 $("#popupWindow").on('open', function () {
259 $("#name").jqxInput('selectAll'); 259 $("#name").jqxInput('selectAll');
260 }); 260 });
261 $("#Delete").jqxButton({ theme: theme }); 261 $("#Delete").jqxButton({ theme: theme });

mercurial