From 0dd6818cc2fe09decd55e438e423bdcb6f7c112b Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 15 Jun 2023 17:34:59 +0900 Subject: [PATCH] =?UTF-8?q?base.js,=20dataset.js=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 | 19 +++++++++++++++---- src/main/webapp/resources/js/base/dataset.js | 2 ++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/resources/js/base/base.js b/src/main/webapp/resources/js/base/base.js index e6871582..8c4ee226 100644 --- a/src/main/webapp/resources/js/base/base.js +++ b/src/main/webapp/resources/js/base/base.js @@ -632,6 +632,13 @@ $.fn.setPaging = function(config) { config.last = function(index, label) {return '
  • '.replace(/{func}/, config.func.replace(/{index}/, label));}; return this.each(function(){ + let list = config.list; + let pagingInfo = list.empty ? "" : 1 + + " ~ " + + numberFormat.format(list.length) + + " / " + numberFormat.format(config.totalSize); + $("#"+ config.prefix + "PagingInfo").html(pagingInfo); + let tag = paginate(config), container = $(this); if (tag) @@ -640,12 +647,16 @@ $.fn.setPaging = function(config) { if (config.hideIfEmpty != false) container.hide(); } - + + }); +} + +$.fn.setPagingInfo = function(config) { + return this.each(function(){ let list = config.list; - let pagingInfo = list.empty ? "" : - numberFormat.format(config.start + 1) + let pagingInfo = list.empty ? "" : 1 + " ~ " - + numberFormat.format(config.start + list.length) + + numberFormat.format(list.length) + " / " + numberFormat.format(config.totalSize); $("#"+ config.prefix + "PagingInfo").html(pagingInfo); }); diff --git a/src/main/webapp/resources/js/base/dataset.js b/src/main/webapp/resources/js/base/dataset.js index 76324a3b..1099c883 100644 --- a/src/main/webapp/resources/js/base/dataset.js +++ b/src/main/webapp/resources/js/base/dataset.js @@ -507,6 +507,8 @@ class Dataset { if (this.empty) return this.setData(obj); + + let state = this.state; let data = this._getDataItems(obj); this._items = this._items.concat(data.items); this._byKeys = {