55 $('#website').jqxTooltip({ content: 'Het website adres.' }); |
55 $('#website').jqxTooltip({ content: 'Het website adres.' }); |
56 $('#email').jqxTooltip({ content: 'Het email adres.' }); |
56 $('#email').jqxTooltip({ content: 'Het email adres.' }); |
57 $('#phone').jqxTooltip({ content: 'Het telefoon nummer.' }); |
57 $('#phone').jqxTooltip({ content: 'Het telefoon nummer.' }); |
58 $('#notes').jqxTooltip({ content: 'Opmerkingen over deze leverancier.' }); |
58 $('#notes').jqxTooltip({ content: 'Opmerkingen over deze leverancier.' }); |
59 |
59 |
60 var url = 'includes/db_inventory_suppliers.php', |
60 var dataRecord = {}, |
|
61 url = 'includes/db_inventory_suppliers.php', |
61 source = { |
62 source = { |
62 datatype: 'json', |
63 datatype: 'json', |
63 cache: false, |
64 cache: false, |
64 datafields: [ |
65 datafields: [ |
65 { name: 'record', type: 'number' }, |
66 { name: 'record', type: 'number' }, |
|
67 { name: 'uuid', type: 'string' }, |
66 { name: 'name', type: 'string' }, |
68 { name: 'name', type: 'string' }, |
67 { name: 'address', type: 'string' }, |
69 { name: 'address', type: 'string' }, |
68 { name: 'city', type: 'string' }, |
70 { name: 'city', type: 'string' }, |
69 { name: 'zip', type: 'string' }, |
71 { name: 'zip', type: 'string' }, |
70 { name: 'country', type: 'string' }, |
72 { name: 'country', type: 'string' }, |
180 // add new row. |
182 // add new row. |
181 addButton.click(function(event) { |
183 addButton.click(function(event) { |
182 editrow = -1; |
184 editrow = -1; |
183 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
185 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
184 $('#name').val('Nieuwe leverancier'); |
186 $('#name').val('Nieuwe leverancier'); |
|
187 dataRecord.uuid = ''; |
185 $('#address').val(''); |
188 $('#address').val(''); |
186 $('#city').val(''); |
189 $('#city').val(''); |
187 $('#zip').val(''); |
190 $('#zip').val(''); |
188 $('#country').val('Nederland'); |
191 $('#country').val('Nederland'); |
189 $('#website').val(''); |
192 $('#website').val(''); |
209 }, buttonclick: function(row) { |
212 }, buttonclick: function(row) { |
210 // open the popup window when the user clicks a button. |
213 // open the popup window when the user clicks a button. |
211 editrow = row; |
214 editrow = row; |
212 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
215 $('#popupWindow').jqxWindow({ position: { x: 110, y: 30 } }); |
213 // get the clicked row's data and initialize the input fields. |
216 // get the clicked row's data and initialize the input fields. |
214 var dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow); |
217 dataRecord = $('#jqxgrid').jqxGrid('getrowdata', editrow); |
215 $('#name').val(dataRecord.name); |
218 $('#name').val(dataRecord.name); |
216 $('#address').val(dataRecord.address); |
219 $('#address').val(dataRecord.address); |
217 $('#city').val(dataRecord.city); |
220 $('#city').val(dataRecord.city); |
218 $('#zip').val(dataRecord.zip); |
221 $('#zip').val(dataRecord.zip); |
219 $('#country').val(dataRecord.country); |
222 $('#country').val(dataRecord.country); |
262 rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
265 rowID = $('#jqxgrid').jqxGrid('getrowid', editrow); |
263 } |
266 } |
264 row = { |
267 row = { |
265 record: rowID, |
268 record: rowID, |
266 name: $('#name').val(), |
269 name: $('#name').val(), |
|
270 uuid: dataRecord.uuid, |
267 address: $('#address').val(), |
271 address: $('#address').val(), |
268 city: $('#city').val(), |
272 city: $('#city').val(), |
269 zip: $('#zip').val(), |
273 zip: $('#zip').val(), |
270 country: $('#country').val(), |
274 country: $('#country').val(), |
271 website: $('#website').val(), |
275 website: $('#website').val(), |