๋ถ๋ชจ์ฐฝ์์ ์์์ฐฝ์ ์๋์ฒ๋ผ ํ์ ์ผ๋ก ์ด์์(html ์ฝ๋๋ ์๋ต)
parent.html
//๋ฒํผ ํด๋ฆญ ์ child๋ผ๋ ํ์
ํธ์ถ
$("#btn").on("click", function() {
//ํ์
ํธ์ถ(openPopUp()์ด๋ผ๋ ๊ณตํตํจ์์์๋ ํ์
ํธ์ถํ๋ค๊ณ ๊ฐ์ )
const popup = openPopUp("/child", 1100, 700, "child");
});
//์์ ํ์
์์ ํธ์ถํ๋ ํจ์(์์์ฐฝ์์ ๋์ด์จ ์ฌ์
์๋ฒํธ, ๊ณ ๊ฐ๋ช
์ ๋ถ๋ชจ์ ํ๋์ ์ ์ฉ)
function chooseClient(clientBizNo, clientNm) {
$("#clientBizNo").val(clientBizNo);
$("#projClientNm").val(clientNm);
}
child.html
/**
* ๊ณ ๊ฐ ๋ชฉ๋ก์์ ๊ณ ๊ฐ๋ช
์ ํ ์ ๋ถ๋ชจ์ฐฝ์ chooseClient() ํธ์ถ ํ ํ์
์ฐฝ ๋ซ๊ธฐ
* @param clientBizNo
* @param clientNm
*/
function onSelectClient(clientBizNo, clientNm) {
// window.opener๋ฅผ ์ฌ์ฉํ์ฌ ๋ถ๋ชจ ์ฐฝ์ chooseClient ํจ์ ํธ์ถ
window.opener.chooseClient(clientBizNo, clientNm);
window.close(); // ํ์
์ฐฝ ๋ซ๊ธฐ
}
//table tr์ ๋ง์ฐ์ค ์ค๋ฒ ์ ์์ ํ์, ๋ง์ฐ์ค ์ค๋ฒ ํด์ ์ ์์ ํด์
$(document).on("mouseenter mouseleave", "#clientTr", function() {
$(this).css("background-color", isHovered ? "" : "#F7BE6D");
isHovered = !isHovered;
});
๋ถ๋ชจ์ฐฝ์์ ์์ ํ์ ์ ์ด๊ณ ์์ ํ์ ์์ ์ ํํ ๊ณ ๊ฐ๋ช ์ ํ ์ ์ฌ์ ์๋ฒํธ, ๊ณ ๊ฐ๋ช ์ ๋ถ๋ชจ์ฐฝ์ ํจ์๋ก ๋๊ธฐ๊ณ
๋ถ๋ชจ์ฐฝ์์ ๋์ด์จ ๊ฐ์ ํ๋์ ์ธํ ํ๋ ์์
'IT > development' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Vue.js] Vue.js ์ฒจ๋ถํ์ผ ์ ๋ก๋ (0) | 2023.08.13 |
---|---|
[JavaScript] ํ ํ๋ฆฟ ๋ฌธ์์ด ์ฌ์ฉ๋ฒ(feat. '(๋ฐฑํฑ)) (2) | 2023.08.13 |
[springBoot] ์๋ก ๋ค๋ฅธ branch๋ฅผ ๋์์ ๋์ฐ๋ ค๋ฉด? (0) | 2023.08.12 |
[Vue.js] ๊ธฐ์กด thymeleaf์ Vue.js ์ ์ฉํ๋ ๋ฐฉ๋ฒ (2) | 2023.08.10 |
[Vue.js] ์ฝ๋ฐฑ ํจ์์์ this ์ฌ์ฉ ์ ์ ์์ (2) | 2023.08.10 |
๋๊ธ