www/js/inv_miscs.js

changeset 34
a720353fada9
parent 21
acb2d8098f19
child 78
f35a38e8c16f
equal deleted inserted replaced
33:2ee6ad5d6f14 34:a720353fada9
22 function createDelElements() { 22 function createDelElements() {
23 $('#eventWindow').jqxWindow({ 23 $('#eventWindow').jqxWindow({
24 theme: theme, 24 theme: theme,
25 position: { x: 490, y: 210 }, 25 position: { x: 490, y: 210 },
26 width: 300, 26 width: 300,
27 height: 145, 27 height: 175,
28 resizable: false, 28 resizable: false,
29 isModal: true, 29 isModal: true,
30 modalOpacity: 0.4, 30 modalOpacity: 0.4,
31 okButton: $('#delOk'), 31 okButton: $('#delOk'),
32 cancelButton: $('#delCancel'), 32 cancelButton: $('#delCancel'),
139 theme: theme, 139 theme: theme,
140 showstatusbar: true, 140 showstatusbar: true,
141 localization: getLocalization(), 141 localization: getLocalization(),
142 renderstatusbar: function (statusbar) { 142 renderstatusbar: function (statusbar) {
143 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); 143 var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
144 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>"); 144 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>");
145 container.append(addButton); 145 container.append(addButton);
146 statusbar.append(container); 146 statusbar.append(container);
147 addButton.jqxButton({ width: 60, height: 20 }); 147 addButton.jqxButton({ theme: theme, width: 120, height: 20 });
148 // add new row. 148 // add new row.
149 addButton.click(function (event) { 149 addButton.click(function (event) {
150 editrow = -1; 150 editrow = -1;
151 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); 151 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } });
152 $("#name").val(''); 152 $("#name").val('');
165 }); 165 });
166 }, 166 },
167 filterable: true, 167 filterable: true,
168 filtermode: 'excel', 168 filtermode: 'excel',
169 columns: [ 169 columns: [
170 { text: 'Ingredient naam', datafield: 'name', width: 250 }, 170 { text: 'Ingredient naam', datafield: 'name', width: 525 },
171 { text: 'Soort', datafield: 'type', width: 90 }, 171 { text: 'Soort', datafield: 'type', align: 'center', cellsalign: 'center', width: 100 },
172 { text: 'Gebruik', datafield: 'use_use', width: 90 }, 172 { text: 'Gebruik', datafield: 'use_use', align: 'center', cellsalign: 'center', width: 100 },
173 { text: 'Tijd', datafield: 'time', width: 90, cellsalign: 'right', cellsformat: 'f2' }, 173 { text: 'Tijd', datafield: 'time', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'f2' },
174 { text: 'Voorraad.', datafield: 'inventory', width: 70, cellsalign: 'right' }, 174 { text: 'Voor. gr/ml.', datafield: 'inventory', width: 110, align: 'right', cellsalign: 'right' },
175 { text: 'Prijs', datafield: 'cost', width: 70, cellsalign: 'right', cellsformat: 'c2' }, 175 { text: 'Prijs kg/l', datafield: 'cost', width: 90, align: 'right', cellsalign: 'right', cellsformat: 'c2' },
176 { text: 'THT datum', datafield: 'tht_date', width: 100 }, 176 { text: 'THT datum', datafield: 'tht_date', width: 100, align: 'center', cellsalign: 'center' },
177 { text: 'Edit', datafield: 'Edit', columntype: 'button', cellsrenderer: function () { 177 { text: 'Wijzig', datafield: 'Edit', columntype: 'button', align: 'center', cellsrenderer: function () {
178 return "Edit"; 178 return "Wijzig";
179 }, buttonclick: function (row) { 179 }, buttonclick: function (row) {
180 // open the popup window when the user clicks a button. 180 // open the popup window when the user clicks a button.
181 editrow = row; 181 editrow = row;
182 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } }); 182 $("#popupWindow").jqxWindow({ position: { x: 230, y: 30 } });
183 // get the clicked row's data and initialize the input fields. 183 // get the clicked row's data and initialize the input fields.

mercurial