แก้ไข op 10 ข้อ
This commit is contained in:
@@ -5,32 +5,32 @@ var eva_create_evaluation_detail_API = "/api/eva_create_evaluation_detail/";
|
||||
|
||||
function eva_create_evaluation_detail_GetSearchParameter() {
|
||||
var eva_create_evaluation_detailSearchObject = new Object();
|
||||
eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val();
|
||||
eva_create_evaluation_detailSearchObject.create_evaluation_id = getUrlParameter("id"); //$("#s_eva_create_evaluation_detail_create_evaluation_id").val();
|
||||
|
||||
return eva_create_evaluation_detailSearchObject;
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
|
||||
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
|
||||
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
|
||||
|
||||
}
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function eva_create_evaluation_detail_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_chief"), data, "id", "fullname", "item_chief", data.chief);
|
||||
$("#eva_create_evaluation_detail_id").val(data.id);
|
||||
$("#eva_create_evaluation_detail_create_evaluation_id").val(data.create_evaluation_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_employee_id"), data, "id", "fullname", "item_employee_id", data.employee_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_chief"), data, "id", "fullname", "item_chief", data.chief);
|
||||
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_GetFromForm() {
|
||||
var eva_create_evaluation_detailObject = new Object();
|
||||
eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val();
|
||||
eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val();
|
||||
eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val();
|
||||
eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val();
|
||||
eva_create_evaluation_detailObject.id = $("#eva_create_evaluation_detail_id").val();
|
||||
eva_create_evaluation_detailObject.create_evaluation_id = $("#eva_create_evaluation_detail_create_evaluation_id").val();
|
||||
eva_create_evaluation_detailObject.employee_id = $("#eva_create_evaluation_detail_employee_id").val();
|
||||
eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chief").val();
|
||||
|
||||
|
||||
return eva_create_evaluation_detailObject;
|
||||
@@ -39,14 +39,14 @@ eva_create_evaluation_detailObject.chief = $("#eva_create_evaluation_detail_chie
|
||||
function eva_create_evaluation_detail_InitialForm(s) {
|
||||
var successFunc = function (result) {
|
||||
eva_create_evaluation_detail_FeedDataToForm(result);
|
||||
eva_create_evaluation_detail_FeedDataToSearchForm(result);
|
||||
eva_create_evaluation_detail_FeedDataToSearchForm(result);
|
||||
if (s) {
|
||||
// Incase model popup
|
||||
$("#eva_create_evaluation_detailModel").modal("show");
|
||||
}
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + "GetBlankItem", successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ function eva_create_evaluation_detail_GoCreate() {
|
||||
//window_open(appsite + "/eva_create_evaluation_detailView/eva_create_evaluation_detail_d");
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_GoEdit(a) {
|
||||
function eva_create_evaluation_detail_GoEdit(a) {
|
||||
|
||||
// Incase model popup
|
||||
eva_create_evaluation_detail_SetEditForm(a);
|
||||
@@ -76,15 +76,15 @@ function eva_create_evaluation_detail_SetEditForm(a) {
|
||||
eva_create_evaluation_detail_editMode = "UPDATE";
|
||||
eva_create_evaluation_detail_FeedDataToForm(result);
|
||||
$("#eva_create_evaluation_detailModel").modal("show");
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + eva_create_evaluation_detail_API + a, successFunc, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_SetCreateForm(s) {
|
||||
eva_create_evaluation_detail_editMode = "CREATE";
|
||||
eva_create_evaluation_detail_InitialForm(s);
|
||||
eva_create_evaluation_detail_InitialForm(s);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_RefreshTable() {
|
||||
@@ -102,8 +102,7 @@ var eva_create_evaluation_detail_customValidation = function (group) {
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_PutUpdate() {
|
||||
if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation))
|
||||
{
|
||||
if (!ValidateForm('eva_create_evaluation_detail', eva_create_evaluation_detail_customValidation)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,9 +114,9 @@ function eva_create_evaluation_detail_PutUpdate() {
|
||||
$("#eva_create_evaluation_detailModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPutRequest(apisite + eva_create_evaluation_detail_API + data.id, data, successFunc1, AlertDanger);
|
||||
}
|
||||
// Create mode
|
||||
@@ -126,9 +125,9 @@ function eva_create_evaluation_detail_PutUpdate() {
|
||||
$("#eva_create_evaluation_detailModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxPostRequest(apisite + eva_create_evaluation_detail_API, data, successFunc2, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -139,9 +138,9 @@ function eva_create_evaluation_detail_GoDelete(a) {
|
||||
$("#eva_create_evaluation_detailModel").modal("hide");
|
||||
AlertSuccess(result.message);
|
||||
eva_create_evaluation_detail_RefreshTable();
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
startLoad();
|
||||
AjaxDeleteRequest(apisite + eva_create_evaluation_detail_API + a, null, successFunc, AlertDanger);
|
||||
}
|
||||
}
|
||||
@@ -153,25 +152,25 @@ var eva_create_evaluation_detailTableV;
|
||||
var eva_create_evaluation_detail_setupTable = function (result) {
|
||||
console.log(result);
|
||||
var groupColumn = 7;
|
||||
tmp = '"';
|
||||
tmp = '"';
|
||||
eva_create_evaluation_detailTableV = $('#eva_create_evaluation_detailTable').DataTable({
|
||||
|
||||
"processing": true,
|
||||
"serverSide": false,
|
||||
"data": result,
|
||||
"select": {
|
||||
"select": {
|
||||
"style": 'multi'
|
||||
},
|
||||
"columns": [
|
||||
{ "data": "" },
|
||||
{ "data": "" },
|
||||
|
||||
{ "data": "employee_no" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "position_name" },
|
||||
{ "data": "position_level_text" },
|
||||
{ "data": "txt_status_chief" },
|
||||
{ "data": "txt_status_supervisor" },
|
||||
{ "data": "department_name" },
|
||||
{ "data": "employee_no" },
|
||||
{ "data": "employee_id_external_linkage_external_name" },
|
||||
{ "data": "position_name" },
|
||||
{ "data": "position_level_text" },
|
||||
{ "data": "txt_status_chief" },
|
||||
{ "data": "txt_status_supervisor" },
|
||||
{ "data": "department_name" },
|
||||
|
||||
],
|
||||
"columnDefs": [
|
||||
@@ -182,37 +181,37 @@ var eva_create_evaluation_detail_setupTable = function (result) {
|
||||
orderable: false,
|
||||
className: 'select-checkbox'
|
||||
},
|
||||
{ "visible": false, "targets": groupColumn }
|
||||
],
|
||||
{ "visible": false, "targets": groupColumn }
|
||||
],
|
||||
"language": {
|
||||
"url": appsite + "/DataTables-1.10.16/thai.json"
|
||||
},
|
||||
"paging": true,
|
||||
"searching": false,
|
||||
"drawCallback": function ( settings ) {
|
||||
"searching": false,
|
||||
"drawCallback": function (settings) {
|
||||
var api = this.api();
|
||||
var rows = api.rows( {page:'current'} ).nodes();
|
||||
var last=null;
|
||||
|
||||
api.column(groupColumn, {page:'current'} ).data().each( function ( group, i ) {
|
||||
if ( last !== group ) {
|
||||
$(rows).eq( i ).before(
|
||||
'<tr class="group"><td colspan="9"><b>หน่วยงาน : '+group+'</b></td></tr>'
|
||||
var rows = api.rows({ page: 'current' }).nodes();
|
||||
var last = null;
|
||||
|
||||
api.column(groupColumn, { page: 'current' }).data().each(function (group, i) {
|
||||
if (last !== group) {
|
||||
$(rows).eq(i).before(
|
||||
'<tr class="group"><td colspan="9"><b>หน่วยงาน : ' + group + '</b></td></tr>'
|
||||
);
|
||||
|
||||
|
||||
last = group;
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
});
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
|
||||
function eva_create_evaluation_detail_InitiateDataTable(id) {
|
||||
startLoad();
|
||||
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(id);
|
||||
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_setupTable, AlertDanger);
|
||||
startLoad();
|
||||
$("#s_eva_create_evaluation_detail_create_evaluation_id").val(id);
|
||||
var p = $.param(eva_create_evaluation_detail_GetSearchParameter());
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?" + p, eva_create_evaluation_detail_setupTable, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_DoSearch() {
|
||||
@@ -220,10 +219,10 @@ function eva_create_evaluation_detail_DoSearch() {
|
||||
var eva_create_evaluation_detail_reload = function (result) {
|
||||
eva_create_evaluation_detailTableV.destroy();
|
||||
eva_create_evaluation_detail_setupTable(result);
|
||||
endLoad();
|
||||
endLoad();
|
||||
};
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?"+p, eva_create_evaluation_detail_reload, AlertDanger);
|
||||
startLoad();
|
||||
AjaxGetRequest(apisite + "/api/eva_create_evaluation_detail/GetListBySearch?" + p, eva_create_evaluation_detail_reload, AlertDanger);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_GetSelect(f) {
|
||||
@@ -233,15 +232,15 @@ function eva_create_evaluation_detail_GetSelect(f) {
|
||||
});
|
||||
//alert(eva_create_evaluation_detail_selectitem);
|
||||
|
||||
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem)
|
||||
rep_eva_x_DoSearch("pdf", eva_create_evaluation_detail_selectitem, 0); // 0 คือ ไม่ต้องต่อท้ายแบบข้อตกลง ออกมา
|
||||
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_SelectAll(){
|
||||
function eva_create_evaluation_detail_SelectAll() {
|
||||
eva_create_evaluation_detailTableV.rows().select();
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_DeselectAll(){
|
||||
function eva_create_evaluation_detail_DeselectAll() {
|
||||
eva_create_evaluation_detailTableV.rows().deselect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user