ปรับปรุงหลายอย่าง
This commit is contained in:
@@ -17,19 +17,40 @@ function eva_create_evaluation_detail_FeedDataToSearchForm(data) {
|
||||
|
||||
//================= Form Data Customizaiton =========================================
|
||||
|
||||
function DropDownClearFormAndFeedWithDataHead(d, result, x, y, z, i) {
|
||||
$(d).html('');
|
||||
$(d).append($("<option></option>")
|
||||
.attr("value", "")
|
||||
.text("อ้างอิงตามแบบประเมิน"));
|
||||
if (z !== "") {
|
||||
$.each(result[z], function (key, value) {
|
||||
$(d).append($("<option></option>")
|
||||
.attr("value", value[x])
|
||||
.text(value[y]));
|
||||
});
|
||||
} else {
|
||||
$.each(result, function (key, value) {
|
||||
$(d).append($("<option></option>")
|
||||
.attr("value", value[x])
|
||||
.text(value[y]));
|
||||
});
|
||||
}
|
||||
$(d).val(i);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_FeedDataToForm(data) {
|
||||
$("#eva_create_evaluation_detail_id").val(data.id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_create_evaluation_id"), data, "external_id", "external_name", "item_create_evaluation_id", 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);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_eva_employee_id"), data, "id", "fullname", "item_eva_employee_id", data.eva_employee_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
|
||||
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_eva_employee_id"), data, "id", "fullname", "item_eva_employee_id", data.eva_employee_id);
|
||||
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor1_id"), data, "id", "fullname", "item_supervisor1_id", data.supervisor1_id);
|
||||
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor2_id"), data, "id", "fullname", "item_supervisor2_id", data.supervisor2_id);
|
||||
$("#eva_create_evaluation_detail_work_period").val(data.work_period);
|
||||
$("#eva_create_evaluation_detail_order_of_data").val(data.order_of_data);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_help_org_id"), data, "id", "external_name", "item_help_org_id", data.help_org_id);
|
||||
$("#eva_create_evaluation_detail_remark").val(data.remark);
|
||||
DropDownClearFormAndFeedWithData($("#eva_create_evaluation_detail_supervisor3_id"), data, "id", "fullname", "item_supervisor3_id", data.supervisor3_id);
|
||||
DropDownClearFormAndFeedWithDataHead($("#eva_create_evaluation_detail_supervisor3_id"), data, "id", "fullname", "item_supervisor3_id", data.supervisor3_id);
|
||||
}
|
||||
|
||||
function eva_create_evaluation_detail_GetFromForm() {
|
||||
|
||||
Reference in New Issue
Block a user