This commit is contained in:
Nakorn Rientrakrunchai
2020-08-16 05:22:17 +07:00
parent 9ad85c83fa
commit cd176eb1d5
8 changed files with 52 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ function rep_eva01_GetSearchParameter(fileType) {
var rep_eva01SearchObject = new Object();
rep_eva01SearchObject.org_id = array_to_string_comma($("#s_rep_eva01_org_id").val());
rep_eva01SearchObject.round_id = $("#s_rep_eva01_round_id").val();
rep_eva01SearchObject.round_text = $("#s_rep_eva01_round_id option:selected").text();
rep_eva01SearchObject.fileType = fileType;
@@ -24,9 +25,26 @@ function rep_eva01_GetSearchParameter(fileType) {
}
function rep_eva01_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva01_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
DropDownClearFormAndFeedWithDataOrg($("#s_rep_eva01_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva01_round_id"), data, "id_guid", "external_name", "item_round_id", data.id_guid);
}
function DropDownClearFormAndFeedWithDataOrg(d, result, x, y, z, i) {
$(d).html('');
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);
}
//================= Form Data Customizaiton =========================================

View File

@@ -15,6 +15,7 @@ function rep_eva02_GetSearchParameter(fileType) {
var rep_eva02SearchObject = new Object();
rep_eva02SearchObject.org_id = array_to_string_comma($("#s_rep_eva02_org_id").val());
rep_eva02SearchObject.round_id = $("#s_rep_eva02_round_id").val();
rep_eva02SearchObject.round_text = $("#s_rep_eva02_round_id option:selected").text();
rep_eva02SearchObject.fileType = fileType;
@@ -24,8 +25,26 @@ function rep_eva02_GetSearchParameter(fileType) {
}
function rep_eva02_FeedDataToSearchForm(data) {
DropDownClearFormAndFeedWithData($("#s_rep_eva02_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva02_round_id"), data, "id", "external_name", "item_round_id", data.round_id);
DropDownClearFormAndFeedWithDataOrg($("#s_rep_eva02_org_id"), data, "id", "external_name", "item_org_id", data.org_id);
DropDownClearFormAndFeedWithData($("#s_rep_eva02_round_id"), data, "id_guid", "external_name", "item_round_id", data.round_id);
}
function DropDownClearFormAndFeedWithDataOrg(d, result, x, y, z, i) {
$(d).html('');
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);
}
//================= Form Data Customizaiton =========================================