function delRow() {
if (id != null) {
swal({
title : "確定操作嗎?",
text : "是否刪除科目\"" + names + "\"",
type : "warning",
showCancelButton : true,
confirmButtonText : '確定'
}, //用來彈出 提示框
function() {
$.ajax({
url : "/TRAMS/subject?operateFlag=delete&id=" + id, // 數據發送方式
type : "post", // 接受數據格式
dataType : "json", // 要傳遞的數據
success : function(data) {
if (data.msg == "success") {
swal('提示', "刪除成功", 'success');
initdatas();
} else {
swal('提示', "刪除失敗", 'error');
}
}
});
});
} else {
swal('提示', '請選擇一行數據!');
}
}