쿠폰발송관리-마케팅대상검색 ajax오류 수정(1)

This commit is contained in:
김현욱
2026-04-23 11:46:07 +09:00
parent 60314eb74f
commit c43eea70c5
4 changed files with 62 additions and 1 deletions

View File

@@ -1850,6 +1850,47 @@ function validateInput(input, opts = {}) {
});
}
/************************************************************
form데이터 sealize 후 json 스트링 형태로 전환
************************************************************ */
function queryToJson(queryString) {
let jsonObj = {};
let pairs = queryString.split("&");
$.each(pairs, function (index, pair) {
let [key, value] = pair.split("=");
if(!fn_is_empty(value)){
jsonObj[key] = value ? decodeURIComponent(value) : "";
}
});
const jsonStr = JSON.stringify(jsonObj);
return jsonStr;
}
/************************************************************
치환코드 입력
* @param eventObj : 클릭객체
* @param closestSelector : 가까운 객체
* @param targetTextAreaSelector : textarea타겟대상
* @property obj : 클릭한 객체
* @property existingVal : 기존 텍스트 아리아 값
* @property addStr : 추가할 치환 코드
* @description 치환 문자 td 클래스에 subst 클래스 부여
************************************************************ */
function fn_set_substituon_in_texatarea(eventObj, closestSelector, targetTextAreaSelector) {
const obj = $(eventObj);
let existingVal = $("#"+targetTextAreaSelector).val();
let addStr;
const addStrT = obj.closest(closestSelector).find(".subst").text();
const addStrV = obj.closest(closestSelector).find(".subst").val();
if(!fn_is_empty(addStrT)){
addStr = addStrT;
}else{
addStr = addStrV;
}
existingVal = existingVal + " " +addStr;
$("#"+targetTextAreaSelector).val(existingVal);
}
/* ************************************************************
* 인피니티 스크롤 공통 처리 (footer가 보이면 callback함수 호출)