From a78fa98b3d23acab6a567ff4109bebfad72e29d5 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 4 May 2019 20:01:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=A5=EC=88=98=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=97=90=20pagenation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/js/select_npc.js | 31 ++++++++++++++++++++++++------- hwe/select_npc.php | 9 +++++++-- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/hwe/js/select_npc.js b/hwe/js/select_npc.js index eb9bb5c6..829d1162 100644 --- a/hwe/js/select_npc.js +++ b/hwe/js/select_npc.js @@ -251,18 +251,31 @@ function printGeneralList(value){ }); window.generalList = generalList; - _printGeneralList(generalList); - - + _printGeneralList(true); } -function _printGeneralList(generalList){ +function _printGeneralList(clear){ var $generalTable = $('#general_list'); - $generalTable.empty(); + if(clear){ + $generalTable.empty(); + $generalTable.data('lastIdx', 0); + $('#row_print_more').show(); + } - $.each(generalList, function(idx, general){ + generalList = window.generalList; + + var idxFrom = $generalTable.data('lastIdx'); + var idxTo = Math.min(idxFrom + 50, generalList.length); + $generalTable.data('lastIdx', idxTo); + + for(var idx = idxFrom; idx < idxFrom + 50; idx++){ + var general = generalList[idx]; $generalTable.append(TemplateEngine(templateGeneralRow, general)); - }); + } + + if(idxTo == generalList.length){ + $('#row_print_more').hide(); + } $generalTable.find('.obj_tooltip').tooltip({ title:function(){ @@ -324,4 +337,8 @@ $('#btn_load_general_list').click(function(){ }); }); +$('#btn_print_more').click(function(){ + _printGeneralList(); +}) + }); \ No newline at end of file diff --git a/hwe/select_npc.php b/hwe/select_npc.php index 70ce5697..4b805620 100644 --- a/hwe/select_npc.php +++ b/hwe/select_npc.php @@ -103,10 +103,10 @@ history.go(-1);
-
+
- +
+ + + + +