From ef828317385975fd35db7ba8e2250a022d9b4c26 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 15 Jun 2023 17:36:19 +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=EA=B3=B5=ED=86=B5=20=EA=B8=B0=EB=8A=A5=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EA=B5=AC=ED=98=84=EB=90=98=EC=96=B4=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/resources/js/base/dataset-fims.js | 89 ------------------- 1 file changed, 89 deletions(-) diff --git a/src/main/webapp/resources/js/base/dataset-fims.js b/src/main/webapp/resources/js/base/dataset-fims.js index d838a821..6d091956 100644 --- a/src/main/webapp/resources/js/base/dataset-fims.js +++ b/src/main/webapp/resources/js/base/dataset-fims.js @@ -28,92 +28,3 @@ class CodeFormat { return txt; } } - -class FimsDatasetControl extends DatasetControl { - constructor(conf) { - super(conf); - this.dataset = new FimsDataset(conf); - - this.infoSizes = conf.infoSizes || {}; - this.titles = conf.titles || {}; - } - - _paginationInfo = { - paging : true, - pagingType : "nav", - fetchSize : 15, - scrollFuncName : null, - pageNum : 1 - } - - totalCountSetting(obj){ - if(document.getElementById('totCnt')){ - var prefix = obj.infoPrefix; - $('#totCnt span').text(obj[prefix+"Total"]); - } - } - - load(pageNum,flag) { - if(this._paginationInfo.paging){ - this.query.fetchSize = this._paginationInfo.fetchSize; - this.query.pageNum = pageNum; - } else { - this.query.fetchSize = 0; - this.query.pageNum = 0; - } - - this._load(flag); - } - - _load(flag) { - if (!this.query.pageNum) - this.query.pageNum = 1; - ajax.get({ - url:this.urls.load, - data:this.query, - success:resp => this.setData(resp,flag) - }); - } - - setData(obj, flag) { - this.dataset.setData(obj,flag); - } - -} - -class FimsDataset extends Dataset { - setData(obj, flag) { - let state = this.state; - this._byKeys = {}; - this._current = null; - - obj = obj || {}; - let array = Array.isArray(obj) ? obj : this.conf.dataGetter(obj) || []; - if (!Array.isArray(array)) - throw new Error("The data must be an array"); - - let oldItems = []; - if(flag != null && flag == "more"){ - oldItems = this._items; - } - - let newitems = []; - newitems = array.map(e => new DataItem(e, this._formats)); - newitems.forEach(item => { - let key = "key-" + this.getKey(item.data); - this._byKeys[key] = item; - }); - - if(flag != null && flag == "more"){ - this._items = oldItems.concat(newitems); - } else { - this._items = newitems; - } - - this.onDatasetChange(obj); - this.setState(!Array.isArray(obj) ? obj.state : state); - this.onDirtiesChange(this.dirty); - - return this; - } -} \ No newline at end of file