From 30f211adf0c3bc4c1314778a61d483aeb45916e8 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Thu, 25 Jul 2024 09:42:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/resources/js/base/base.js | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/resources/js/base/base.js b/src/main/webapp/resources/js/base/base.js index 2fde6b5..3adcff6 100644 --- a/src/main/webapp/resources/js/base/base.js +++ b/src/main/webapp/resources/js/base/base.js @@ -629,12 +629,14 @@ $.fn.setPaging = function(config) { config.current = function(index, label) {return '
  • {label}
  • '.replace(/{label}/, label);}; config.next = function(index, label) {return ''.replace(/{func}/, config.func.replace(/{index}/, label));}; config.last = function(index, label) {return '
  • '.replace(/{func}/, config.func.replace(/{index}/, label));}; - + return this.each(function(){ - let list = config.list, - start = list.empty ? 0 : config.start + 1, - end = list.empty ? 0 : config.start + list.length, - pagingInfo = list.empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize); + let length = config.list ? config.list.length : config.dataLength, + empty = length < 1, + start = empty ? 0 : config.start + 1, + end = empty ? 0 : config.start + length, + pagingInfo = empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize); + $("#"+ config.prefix + "PagingInfo").html(pagingInfo); let tag = paginate(config), @@ -651,11 +653,13 @@ $.fn.setPaging = function(config) { $.fn.setPagingInfo = function(config) { return this.each(function(){ - let list = config.list; - let pagingInfo = list.empty ? "" : 1 - + " ~ " - + numberFormat.format(list.length) - + " / " + numberFormat.format(config.totalSize); + let length = config.list ? config.list.length : config.dataLength, + empty = length < 1, + pagingInfo = empty ? "" : 1 + + " ~ " + + numberFormat.format(length) + + " / " + numberFormat.format(config.totalSize); + $("#"+ config.prefix + "PagingInfo").html(pagingInfo); }); }