www/js/inv_suppliers.js

changeset 785
aa79acfdf8a9
parent 767
08c0343b622b
--- a/www/js/inv_suppliers.js	Sun Feb 06 20:06:46 2022 +0100
+++ b/www/js/inv_suppliers.js	Thu Feb 10 22:15:10 2022 +0100
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2014-2021
+ * Copyright (C) 2014-2022
  *
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -57,12 +57,14 @@
  $('#phone').jqxTooltip({ content: 'Het telefoon nummer.' });
  $('#notes').jqxTooltip({ content: 'Opmerkingen over deze leverancier.' });
 
- var url = 'includes/db_inventory_suppliers.php',
+ var dataRecord = {},
+ url = 'includes/db_inventory_suppliers.php',
  source = {
   datatype: 'json',
   cache: false,
   datafields: [
    { name: 'record', type: 'number' },
+   { name: 'uuid', type: 'string' },
    { name: 'name', type: 'string' },
    { name: 'address', type: 'string' },
    { name: 'city', type: 'string' },
@@ -182,6 +184,7 @@
     editrow = -1;
     $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
     $('#name').val('Nieuwe leverancier');
+    dataRecord.uuid = '';
     $('#address').val('');
     $('#city').val('');
     $('#zip').val('');
@@ -211,7 +214,7 @@
      editrow = row;
      $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } });
      // get the clicked row's data and initialize the input fields.
-     var dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
+     dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow);
      $('#name').val(dataRecord.name);
      $('#address').val(dataRecord.address);
      $('#city').val(dataRecord.city);
@@ -264,6 +267,7 @@
   row = {
    record: rowID,
    name: $('#name').val(),
+   uuid: dataRecord.uuid,
    address: $('#address').val(),
    city: $('#city').val(),
    zip: $('#zip').val(),

mercurial