From 790e550326a22aa794dc22c1c19920e8fe762035 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 19 Sep 2023 18:10:15 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EC=97=B4=20?= =?UTF-8?q?=EB=84=88=EB=B9=84=20=EC=B6=95=EC=86=8C(160px)=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8A=94=20=ED=95=A8=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/jsp/include/tail.jsp | 2 + .../js/fims/framework/cmm/downsize.js | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/main/webapp/resources/js/fims/framework/cmm/downsize.js diff --git a/src/main/webapp/WEB-INF/jsp/include/tail.jsp b/src/main/webapp/WEB-INF/jsp/include/tail.jsp index 156a0f60..c9445492 100644 --- a/src/main/webapp/WEB-INF/jsp/include/tail.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/tail.jsp @@ -53,6 +53,8 @@ + + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/downsize.js b/src/main/webapp/resources/js/fims/framework/cmm/downsize.js new file mode 100644 index 00000000..863664f9 --- /dev/null +++ b/src/main/webapp/resources/js/fims/framework/cmm/downsize.js @@ -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); + }); + +}; \ No newline at end of file