From e01d748ed27be43eb386acc69a7c3cf4eddca611 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Mon, 13 Mar 2023 21:06:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B7=B8=EB=A6=AC=EB=93=9C=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20type=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A0=95=EB=B3=B4=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/js/cmm/xit-tui-grid.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/resources/framework/js/cmm/xit-tui-grid.js b/src/main/webapp/resources/framework/js/cmm/xit-tui-grid.js index 205ee05b..de5ad0ef 100644 --- a/src/main/webapp/resources/framework/js/cmm/xit-tui-grid.js +++ b/src/main/webapp/resources/framework/js/cmm/xit-tui-grid.js @@ -76,9 +76,10 @@ class CustomRowNumberRenderer { } getRowNum(props) { - const currentPage = props.grid.getPagination()._currentPage; + // paging 처리시 : scroll인 경우 제외 + const currentPage = props.grid.getPagination()?._currentPage; // You can change the number `5` as your perPage option. - return Number(props.formattedValue) + (currentPage - 1) * props.grid.getPagination()._options.itemsPerPage; + return Number(props.formattedValue) + (currentPage - 1) * props.grid.getPagination()?._options?.itemsPerPage; } getElement() { @@ -140,16 +141,18 @@ const TuiGrid = { this.instance = null; // rowNum fix - options.rowHeaders.filter((r, idx) => { - if(r === 'rowNum'){ - options.rowHeaders[idx] = { - type: 'rowNum', - renderer: { - type: CustomRowNumberRenderer + if(options.pageOptions?.type !== 'scroll') { + options.rowHeaders.filter((r, idx) => { + if (r === 'rowNum') { + options.rowHeaders[idx] = { + type: 'rowNum', + renderer: { + type: CustomRowNumberRenderer + } } } - } - }) + }) + } const newOptions = $.extend(true, {}, this.defaultOptions, options, {data: dataSource}); newOptions.el = document.getElementById(options.el); //this.elId = options.el;