--- a/www/js/inv_miscs.js Sat May 23 17:33:35 2020 +0200 +++ b/www/js/inv_miscs.js Sat May 23 20:01:50 2020 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2014-2019 + * Copyright (C) 2014-2020 * * Michiel Broek <mbroek at mbse dot eu> * @@ -177,13 +177,12 @@ theme: theme, showstatusbar: true, renderstatusbar: function(statusbar) { - var container, addButton, impButton; - container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); - addButton = $('<div style="float: right; margin-right: 15px;"><img style="position: relative; margin-top: 2px;" ' + + var container = $('<div style="overflow: hidden; position: relative; margin: 5px;"></div>'); + 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>'); - impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + + var impButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + 'src="images/add.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Import</span></div>'); - expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + + var expButton = $('<div style="float: right; margin-right: 50px;"><img style="position: relative; margin-top: 2px;" ' + 'src="images/database.png"/><span style="margin-left: 4px; position: relative; top: -3px;">Export</span></div>'); container.append(addButton); container.append(impButton); @@ -330,6 +329,26 @@ $('#popupWindow').jqxWindow('hide'); }); $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); + $('#Clone').jqxButton({ template: 'warning', width: '90px', theme: theme }); + $('#Clone').click(function() { + var row = { + record: -1, + name: $('#name').val() + ' kopie', + type: $('#type').val(), + use_use: $('#use_use').val(), + time: parseFloat($('#time').jqxNumberInput('decimal')), + amount_is_weight: $('#amount_is_weight').val(), + use_for: $('#use_for').val(), + notes: $('#notes').val(), + always_on_stock: $('#always_on_stock').val(), + inventory: 0, + cost: parseFloat($('#cost').jqxNumberInput('decimal')), + production_date: '', + tht_date: '' + }; + $('#jqxgrid').jqxGrid('addrow', null, row); + $('#popupWindow').jqxWindow('hide'); + }); $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); // update the edited row when the user clicks the 'Save' button. $('#Save').click(function() {