INSERT 문을 구성할 때 문자열 값이라는 의미를 외따옴표로 시작해서 외따옴표로 끝납니다. 그렇다면 외따옴표 자체를 문자열 값으로 넣고 싶다면… 외따움표를 2개 넣어주면 됩니다. 그리고 줄간행(Carrage Return) 문자는 아스키값 10번이므로 CHR(10)가 되는데.. 이처럼 값이 외따옴표일때와 줄간행 문자에 대한 저장을 위해 다음 코드 예시가 도움이 되길 바랍니다.
`;
dlg.resizablePanel.style.width = "30em"; // 대화상자의 크기 지정(대화상자 자체에 대한 크기 조절로는 안됨)
dlg.resizablePanel.minWidth = 400; // 대화창의 크기 조절 시 가로 최소 크기
dlg.resizablePanel.minHeight = 200; // 대화창의 크기 조절 시 세로 최소 크기
// 대화 상자의 크기 조절에 따른 구성 UI의 크기 조절
// CSS 만으로 제어할 수 없는 구성 UI는 크기 변경 이벤트를 통해 제어할 수 있음
dlg.resizablePanel.addEventListener("change", (event) => {
const { mode, oldHeight, newHeight } = event.detail;
if(mode === "BOTTOM" || mode == "TOP") {
const domSomething = dlg.content.querySelector(".something");
const height = parseFloat(window.getComputedStyle(domSomething).getPropertyValue("height"));
domSomething.style.height = `${height - (oldHeight - newHeight)}px`;
}
});
dlg.content.querySelector("gwc-button").addEventListener("click", () => {
dlg.remove();
});
dlg.show();
GeoServiceWebComponentManager.instance.update();
});
};
실행 결과는 다음과 같습니다.
대화창을 구성하는 UI의 상태(값)이 변경되면 변경에 대한 처리를 한곳에서 처리할 수 있는 state 관리가 가능합니다. 코드의 예는 다음과 같습니다.