IT/development

[thymeleaf] thymeleaf javascript๋กœ ๋ณ€์ˆ˜ 1๊ฐœ ์ด์ƒ ์ „๋‹ฌ

์•Œ ์ˆ˜ ์—†๋Š” ์‚ฌ์šฉ์ž 2023. 5. 30.
<!-- ํ…Œ์ด๋ธ”์ด ์žˆ๊ณ  ์•„๋ž˜์ฒ˜๋Ÿผ tr์„ ๋ฃจํ”„๋Œ๋ฆฐ๋‹ค๊ณ  ๊ฐ€์ • -->
<tr th:each="list : ${list}">
<!-- ์•„๋ž˜์ฒ˜๋Ÿผ th:onclick์—์„œ list์—์„œ ๊ฐ€์ ธ์˜จ empId, annualSno๋ฅผ ์ „๋‹ฌ -->
<td><a href="#" th:onclick="ViewPop([[${list.empId}]],[[${list.annualSno}]]);" th:text="${list.empNm}"></a></td>
...
</tr>

//์ƒ์„ธ ํŒ์—…(2๊ฐœ์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ๋ฐ›์Œ)
    function annualViewPop(id, sno) {
        const width = 750;
        const height = 600;
        const left = (window.innerWidth - width) / 2;
        const top = (window.innerHeight - height) / 2;
		        
        const popWindow = window.open("/viewPop?empId=" + id + "&annualSno=" + sno, "viewPop", "width=" + width + ", height=" + height + ", left=" + left + ", top=" + top);
    }

์•„๋ž˜๊ฐ€ ํ•ต์‹ฌ

th:onclick="ViewPop([[${list.empId}]],[[${list.annualSno}]]);"

 

'IT > development' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[mybatis] mybatis oracle merge into  (0) 2023.06.03
[spring] springBoot ajax json๊ณผ file ์ „์†ก  (1) 2023.06.03
[springBoot] ๊ณตํœด์ผ ์กฐํšŒ API  (0) 2023.05.15
[logback] log pattern ์„ค์ •  (2) 2023.05.14
[thymeleaf] if unless ์กฐ๊ฑด  (0) 2023.05.13

๋Œ“๊ธ€