<!-- 테이블이 있고 아래처럼 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' 카테고리의 다른 글
| [logback] log pattern 설정 (0) | 2025.11.24 |
|---|---|
| [springBoot] 공휴일 조회 API (0) | 2025.11.23 |
| [spring] springBoot ajax json과 file 전송 (0) | 2025.11.23 |
| [mybatis] mybatis oracle merge into (0) | 2025.11.23 |
| [springBoot/thymeleaf] ajax 페이지네이션 sample(feat. study용) (0) | 2025.11.23 |
댓글