2662 $('#st_abv_min').val(datarecord.abv_min); |
2662 $('#st_abv_min').val(datarecord.abv_min); |
2663 $('#st_abv_max').val(datarecord.abv_max); |
2663 $('#st_abv_max').val(datarecord.abv_max); |
2664 } |
2664 } |
2665 }); |
2665 }); |
2666 |
2666 |
2667 function saveRecord() { |
2667 function saveRecord(goback) { |
2668 var row = { |
2668 var row = { |
2669 record: my_record, |
2669 record: my_record, |
2670 uuid: dataRecord.uuid, |
2670 uuid: dataRecord.uuid, |
2671 name: $('#name').val(), |
2671 name: $('#name').val(), |
2672 locked: dataRecord.locked, |
2672 locked: dataRecord.locked, |
2763 cache: false, |
2763 cache: false, |
2764 async: false, |
2764 async: false, |
2765 data: data, |
2765 data: data, |
2766 type: 'POST', |
2766 type: 'POST', |
2767 success: function(data, status, xhr) { |
2767 success: function(data, status, xhr) { |
2768 console.log('saveRecord() success'); |
2768 console.log('saveRecord(' + goback + ') success'); |
|
2769 if (goback) |
|
2770 window.location.href = my_return; |
|
2771 else |
|
2772 window.location.href = 'rec_export.php?record=' + my_record + '&return=' + my_return + '&name=' + dataRecord.name; |
2769 }, |
2773 }, |
2770 error: function(jqXHR, textStatus, errorThrown) { |
2774 error: function(jqXHR, textStatus, errorThrown) { |
2771 console.log('saveRecord() error'); |
2775 console.log('saveRecord() ' + textStatus); |
2772 } |
2776 } |
2773 }); |
2777 }); |
2774 }; |
2778 }; |
2775 |
2779 |
2776 dataAdapter.dataBind(); |
2780 dataAdapter.dataBind(); |
3953 }); |
3957 }); |
3954 |
3958 |
3955 // Buttons below |
3959 // Buttons below |
3956 $('#Export').jqxButton({ template: 'info', width: '80px', theme: theme }); |
3960 $('#Export').jqxButton({ template: 'info', width: '80px', theme: theme }); |
3957 $('#Export').bind('click', function() { |
3961 $('#Export').bind('click', function() { |
3958 saveRecord(); |
3962 saveRecord(0); |
3959 window.location.href = 'rec_export.php?record=' + my_record + '&return=' + my_return + '&name=' + dataRecord.name; |
|
3960 }); |
3963 }); |
3961 |
3964 |
3962 $('#Delete').jqxButton({ template: 'danger', width: '80px', theme: theme }); |
3965 $('#Delete').jqxButton({ template: 'danger', width: '80px', theme: theme }); |
3963 $('#Delete').bind('click', function() { |
3966 $('#Delete').bind('click', function() { |
3964 // Open a popup to confirm this action. |
3967 // Open a popup to confirm this action. |
3986 window.location.href = my_return; |
3989 window.location.href = my_return; |
3987 }); |
3990 }); |
3988 |
3991 |
3989 $('#Save').jqxButton({ template: 'success', width: '80px', theme: theme }); |
3992 $('#Save').jqxButton({ template: 'success', width: '80px', theme: theme }); |
3990 $('#Save').bind('click', function() { |
3993 $('#Save').bind('click', function() { |
3991 saveRecord(); |
3994 saveRecord(1); |
3992 window.location.href = my_return; |
|
3993 }); |
3995 }); |
3994 createDelElements(); |
3996 createDelElements(); |
3995 }); |
3997 }); |
3996 |
3998 |