그리드 열 너비 축소(160px) 처리하는 함수 추가

main
이범준 1 year ago
parent 41eff3ae7d
commit 790e550326

@ -53,6 +53,8 @@
<script src="<c:url value="/resources/js/fims/framework/cmm/initAfterPageLoad.js?${ver}"/>"></script>
<!-- 검색 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/searchUtil.js?${ver}"/>"></script>
<!-- 그리드 열 너비 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/downsize.js?${ver}"/>"></script>
<!-- 단축키 설정 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/shortcutKey.js?${ver}"/>"></script>

@ -0,0 +1,45 @@
//테이블 렌더링 후 축소 처리할 컬럼 확인
function fnDownsizeCheck(tableObj) {
$(tableObj).find("thead tr th").each(function(){
var thIndex = $(this).index();
if($(this).hasClass("downsize")){
var trs = $(this).parent("tr").parent("thead").next("tbody").find("tr");
trs.each(function(){
$(this).find("td:eq("+thIndex+")").css("max-width","160px");
});
}
});
}
//테이블 컬럼 축소 여부 변경
function fnDownsizeToggle(thObj) {
$(thObj).toggleClass("downsize");
var thIndex = $(thObj).index();
var setValue = "";
if($(thObj).hasClass("downsize")){
setValue = "160px";
}
var tbody = $(thObj).parent("tr").parent("thead").next("tbody");
if(tbody.length < 1){
return;
}
var trs = tbody.find("tr");
if(trs.length < 1){
return;
}
if(trs.length == 1 && trs.find("td").length <= 1){
return;
}
trs.each(function(){
$(this).find("td:eq("+thIndex+")").css("max-width",setValue);
});
};
Loading…
Cancel
Save