1 /***************************************************************************** |
1 /***************************************************************************** |
2 * Copyright (C) 2014-2019 |
2 * Copyright (C) 2014-2020 |
3 * |
3 * |
4 * Michiel Broek <mbroek at mbse dot eu> |
4 * Michiel Broek <mbroek at mbse dot eu> |
5 * |
5 * |
6 * This is free software; you can redistribute it and/or modify it |
6 * This is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License as published by the |
7 * under the terms of the GNU General Public License as published by the |
175 height: 630, |
175 height: 630, |
176 source: dataAdapter, |
176 source: dataAdapter, |
177 theme: theme, |
177 theme: theme, |
178 showstatusbar: true, |
178 showstatusbar: true, |
179 renderstatusbar: function(statusbar) { |
179 renderstatusbar: function(statusbar) { |
180 var container, addButton, impButton; |
180 var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
181 container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); |
181 var addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
182 addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + |
|
183 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>'); |
182 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Nieuw</span></div>'); |
184 impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
183 var impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
185 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>'); |
184 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>'); |
186 expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
185 var expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + |
187 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Export</span></div>'); |
186 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Export</span></div>'); |
188 container.append(addButton); |
187 container.append(addButton); |
189 container.append(impButton); |
188 container.append(impButton); |
190 container.append(expButton); |
189 container.append(expButton); |
191 statusbar.append(container); |
190 statusbar.append(container); |
328 }); |
327 }); |
329 } |
328 } |
330 $('#popupWindow').jqxWindow('hide'); |
329 $('#popupWindow').jqxWindow('hide'); |
331 }); |
330 }); |
332 $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); |
331 $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); |
|
332 $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme }); |
|
333 $('#Clone').click(function() { |
|
334 var row = { |
|
335 record: -1, |
|
336 name: $('#name').val() + ' kopie', |
|
337 type: $('#type').val(), |
|
338 use_use: $('#use_use').val(), |
|
339 time: parseFloat($('#time').jqxNumberInput('decimal')), |
|
340 amount_is_weight: $('#amount_is_weight').val(), |
|
341 use_for: $('#use_for').val(), |
|
342 notes: $('#notes').val(), |
|
343 always_on_stock: $('#always_on_stock').val(), |
|
344 inventory: 0, |
|
345 cost: parseFloat($('#cost').jqxNumberInput('decimal')), |
|
346 production_date: '', |
|
347 tht_date: '' |
|
348 }; |
|
349 $('#jqxgrid').jqxGrid('addrow', null, row); |
|
350 $('#popupWindow').jqxWindow('hide'); |
|
351 }); |
333 $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); |
352 $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); |
334 // update the edited row when the user clicks the 'Save' button. |
353 // update the edited row when the user clicks the 'Save' button. |
335 $('#Save').click(function() { |
354 $('#Save').click(function() { |
336 var row, rowID = -1; |
355 var row, rowID = -1; |
337 if (editrow >= 0) { |
356 if (editrow >= 0) { |