251 $('#popupWindow').on('open', function() { |
251 $('#popupWindow').on('open', function() { |
252 $('#dev_description').jqxInput('selectAll'); |
252 $('#dev_description').jqxInput('selectAll'); |
253 }); |
253 }); |
254 $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme }); |
254 $('#Delete').jqxButton({ template: 'danger', width: '90px', theme: theme }); |
255 $('#Delete').click(function() { |
255 $('#Delete').click(function() { |
256 if (editrow >= 0) { |
256 // Open a popup to confirm this action. |
257 // Open a popup to confirm this action. |
257 $('#eventWindow').jqxWindow('open'); |
258 $('#eventWindow').jqxWindow('open'); |
258 $('#delOk').click(function() { |
259 $('#delOk').click(function() { |
259 // var data, |
260 var data, |
260 var data = 'del=true&uuid=' + $('#dev_uuid').val(); |
261 data = 'del=true&uuid=' + $('#dev_uuid').val(); |
261 $.ajax({ |
262 $.ajax({ |
262 dataType: 'json', |
263 dataType: 'json', |
263 url: url, |
264 url: url, |
264 cache: false, |
265 cache: false, |
265 data: data, |
266 data: data, |
266 type: 'POST', |
267 type: 'POST', |
267 success: function(data) { |
268 success: function(data) { |
268 if (data.error) { |
269 if (data.error) { |
269 console.log('del: ' + data.msg); |
270 console.log('del: ' + data.msg); |
270 alert('Error: ' + data.msg); |
271 alert('Error: ' + data.msg); |
271 } else { |
272 } else { |
272 console.log('del: success'); |
273 console.log('del: success'); |
273 } |
274 } |
274 }, |
275 }, |
275 error: function(jqXHR, textStatus, errorThrown) {} |
276 error: function(jqXHR, textStatus, errorThrown) {} |
|
277 }); |
|
278 $('#jqxgrid').jqxGrid('updatebounddata'); |
|
279 }); |
276 }); |
280 } |
277 $('#jqxgrid').jqxGrid('updatebounddata'); |
|
278 }); |
281 $('#popupWindow').jqxWindow('hide'); |
279 $('#popupWindow').jqxWindow('hide'); |
282 }); |
280 }); |
283 $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); |
281 $('#Cancel').jqxButton({ template: 'primary', width: '90px', theme: theme }); |
284 $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); |
282 $('#Save').jqxButton({ template: 'success', width: '90px', theme: theme }); |
285 $('#Save').click(function() { |
283 $('#Save').click(function() { |