<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="pageKorName" scope="request">시군구 목록</c:set>
<div class="content-wrapper">
	<div class="container-xxl flex-grow-1 px-0">
		<div class="card wrapper-list">
			<h1>시군구 선택</h1>
			<div id="btnsGoToEditSgg--${pageName}">
				<c:forEach items="${sggList}" var="item">
					<c:if test="${item.SGG_CD ne 'ADMIN'}">
						<button type="button" data-value="${item.SGG_CD}" class="w-px-200" 
						onclick="fnGoToEditSgg('${item.SGG_CD}')">
						${item.SGG_NM}(${item.SGG_CD})
						</button>
					</c:if>
				</c:forEach>
			</div>
		</div>
	</div>
</div>
<script>
function fnGoToEditSgg(selected){

	let menuUrl = wctx.url("/ogdp/sggStngMain.do");
	
	let curTabId = FimsSupport.getActiveRootTabArea().id;
	
	ajax.get({
		url: menuUrl,
		data : { sggCd : selected },
		success:(resp) => {
			$("#main-tab-content").find("div[id='"+curTabId+"']").html(resp);
		}
	});
	
}
</script>