diff --git a/src/main/webapp/resources/js/fims/cmmn/searchUtil.js b/src/main/webapp/resources/js/fims/cmmn/searchUtil.js index a7f1a367..8d2add6c 100644 --- a/src/main/webapp/resources/js/fims/cmmn/searchUtil.js +++ b/src/main/webapp/resources/js/fims/cmmn/searchUtil.js @@ -3,8 +3,9 @@ **************************************************************************/ function searchFromGridTitle(byValue, byOutputValue, mainOption, subOption){ var tr = event.target.parentElement; - - if($(tr).attr("data-search-target").length < 1){ + + if($(tr).attr("data-search-target") == null || $(tr).attr("data-search-target") == ""){ + var trDataset = tr.dataset; var byElementId = trDataset.by; @@ -18,11 +19,11 @@ function searchFromGridTitle(byValue, byOutputValue, mainOption, subOption){ document.getElementById(mainOptionElementId).value = mainOption; document.getElementById(subOptionElementId).value = subOption; } else { - - let byEl = $($(tr).attr("data-search-target")).find("[name='by']"); - let byOutputEl = $($(tr).attr("data-search-target")).find("[name='byOutput']"); - let mainOptionEl = $($(tr).attr("data-search-target")).find("[name='mainOption']"); - let subOptionEl = $($(tr).attr("data-search-target")).find("[name='subOption']"); + + let byEl = $($(tr).attr("data-search-target")).find("[name='by']")[0]; + let byOutputEl = $($(tr).attr("data-search-target")).find("[name='byOutput']")[0]; + let mainOptionEl = $($(tr).attr("data-search-target")).find("[name='mainOption']")[0]; + let subOptionEl = $($(tr).attr("data-search-target")).find("[name='subOption']")[0]; byEl.value = snakeToCamel(byValue); byOutputEl.value = byOutputValue;