www/js/prod_edit.js

changeset 489
18e5cfe5d126
parent 484
2083c274b283
child 490
6c9ad1317f0a
equal deleted inserted replaced
488:77f1617b6994 489:18e5cfe5d126
4167 calcWater(); 4167 calcWater();
4168 calcSparge(); 4168 calcSparge();
4169 } 4169 }
4170 }); 4170 });
4171 4171
4172 function saveRecord() { 4172 function saveRecord(goback) {
4173 console.log('saveRecord()');
4174 var row = { 4173 var row = {
4175 record: my_record, 4174 record: my_record,
4176 uuid: dataRecord.uuid, 4175 uuid: dataRecord.uuid,
4177 name: $('#name').val(), 4176 name: $('#name').val(),
4178 code: $('#code').val(), 4177 code: $('#code').val(),
4382 cache: false, 4381 cache: false,
4383 data: data, 4382 data: data,
4384 async: false, 4383 async: false,
4385 type: 'POST', 4384 type: 'POST',
4386 success: function(data, status, xhr) { 4385 success: function(data, status, xhr) {
4387 console.log('saveRecord() success'); 4386 console.log('saveRecord(' + goback + ') success');
4387 if (goback)
4388 window.location.href = my_return;
4389 else
4390 window.location.href =
4391 'prod_export.php?record=' + my_record + '&return=' + my_return + '&select=' + my_select + '&code=' + dataRecord.code + '&name=' + dataRecord.name;
4388 }, 4392 },
4389 error: function(jqXHR, textStatus, errorThrown) { 4393 error: function(jqXHR, textStatus, errorThrown) {
4390 console.log('saveRecord() error'); 4394 console.log('saveRecord() ' + textStatus);
4391 } 4395 }
4392 }); 4396 });
4393 }; 4397 };
4394 4398
4395 dataAdapter.dataBind(); 4399 dataAdapter.dataBind();
6021 }); 6025 });
6022 6026
6023 // Buttons below 6027 // Buttons below
6024 $('#Export').jqxButton({ template: 'info', width: '80px', theme: theme }); 6028 $('#Export').jqxButton({ template: 'info', width: '80px', theme: theme });
6025 $('#Export').bind('click', function() { 6029 $('#Export').bind('click', function() {
6026 saveRecord(); 6030 saveRecord(0);
6027 window.location.href =
6028 'prod_export.php?record=' + my_record + '&return=' + my_return + '&select=' + my_select + '&code=' + dataRecord.code + '&name=' + dataRecord.name;
6029 }); 6031 });
6030 6032
6031 $('#Delete').jqxButton({ template: 'danger', width: '80px', theme: theme }); 6033 $('#Delete').jqxButton({ template: 'danger', width: '80px', theme: theme });
6032 $('#Delete').bind('click', function() { 6034 $('#Delete').bind('click', function() {
6033 // Open a popup to confirm this action. 6035 // Open a popup to confirm this action.
6055 window.location.href = my_return; 6057 window.location.href = my_return;
6056 }); 6058 });
6057 6059
6058 $('#Save').jqxButton({ template: 'success', width: '80px', theme: theme }); 6060 $('#Save').jqxButton({ template: 'success', width: '80px', theme: theme });
6059 $('#Save').bind('click', function() { 6061 $('#Save').bind('click', function() {
6060 saveRecord(); 6062 saveRecord(1);
6061 window.location.href = my_return;
6062 }); 6063 });
6063 createDelElements(); 6064 createDelElements();
6064 }); 6065 });
6065 6066

mercurial