1501 var data = "update=true&" + $.param(row); |
1501 var data = "update=true&" + $.param(row); |
1502 $.ajax({ |
1502 $.ajax({ |
1503 dataType: 'json', |
1503 dataType: 'json', |
1504 url: url, |
1504 url: url, |
1505 cache: false, |
1505 cache: false, |
|
1506 async: false, |
1506 data: data, |
1507 data: data, |
1507 type: "POST", |
1508 type: "POST", |
1508 success: function (data, status, xhr) { |
1509 success: function (data, status, xhr) { |
|
1510 console.log("saveRecord() success"); |
1509 }, |
1511 }, |
1510 error: function(jqXHR, textStatus, errorThrown) { |
1512 error: function(jqXHR, textStatus, errorThrown) { |
|
1513 console.log("saveRecord() error"); |
1511 } |
1514 } |
1512 }); |
1515 }); |
1513 }; |
1516 }; |
1514 |
1517 |
1515 var dataRecord = {}; |
1518 var dataRecord = {}; |
3669 autoHeight: false, |
3672 autoHeight: false, |
3670 position: 'top' |
3673 position: 'top' |
3671 }); |
3674 }); |
3672 |
3675 |
3673 $("#Print").jqxButton({ template: "info", width: '80px', theme: theme }); |
3676 $("#Print").jqxButton({ template: "info", width: '80px', theme: theme }); |
3674 $("#Print").click(function () { |
3677 $("#Print").bind('click', function () { |
3675 saveRecord(); |
3678 saveRecord(); |
3676 // Open print in a new tab. |
3679 // Open print in a new tab. |
3677 var url="rec_print.php?record=" + my_record; |
3680 var url="rec_print.php?record=" + my_record; |
3678 window.open(url); |
3681 window.open(url); |
3679 }); |
3682 }); |
3680 |
3683 |
3681 $("#Export").jqxButton({ template: "info", width: '80px', theme: theme }); |
3684 $("#Export").jqxButton({ template: "info", width: '80px', theme: theme }); |
3682 $("#Export").click(function () { |
3685 $("#Export").bind('click', function () { |
3683 saveRecord(); |
3686 saveRecord(); |
3684 var url="rec_export.php?record=" + my_record + "&return=" + my_return + "&name=" + dataRecord.name; |
3687 var url="rec_export.php?record=" + my_record + "&return=" + my_return + "&name=" + dataRecord.name; |
3685 window.location.href = url; |
3688 window.location.href = url; |
3686 }); |
3689 }); |
3687 |
3690 |
3688 $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); |
3691 $("#Delete").jqxButton({ template: "danger", width: '80px', theme: theme }); |
3689 $("#Delete").click(function () { |
3692 $("#Delete").bind('click', function () { |
3690 // Open a popup to confirm this action. |
3693 // Open a popup to confirm this action. |
3691 $('#eventWindow').jqxWindow('open'); |
3694 $('#eventWindow').jqxWindow('open'); |
3692 $("#delOk").click(function () { |
3695 $("#delOk").click(function () { |
3693 var data = "delete=true&" + $.param({ record: my_record }); |
3696 var data = "delete=true&" + $.param({ record: my_record }); |
3694 $.ajax({ |
3697 $.ajax({ |
3706 }); |
3709 }); |
3707 }); |
3710 }); |
3708 }); |
3711 }); |
3709 |
3712 |
3710 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme }); |
3713 $("#Cancel").jqxButton({ template: "primary", width: '80px', theme: theme }); |
3711 $("#Cancel").click(function () { |
3714 $("#Cancel").bind('click', function () { |
3712 window.location.href = my_return; |
3715 window.location.href = my_return; |
3713 }); |
3716 }); |
3714 |
3717 |
3715 $("#Save").jqxButton({ template: "success", width: '80px', theme: theme }); |
3718 $("#Save").jqxButton({ template: "success", width: '80px', theme: theme }); |
3716 $("#Save").click(function () { |
3719 $("#Save").bind('click', function () { |
3717 saveRecord(); |
3720 saveRecord(); |
3718 window.location.href = my_return; |
3721 window.location.href = my_return; |
3719 }); |
3722 }); |
3720 createDelElements(); |
3723 createDelElements(); |
3721 }); |
3724 }); |