{"id":21560900,"url":"https://github.com/pouu69/backbone.pagercollection","last_synced_at":"2025-03-18T04:29:32.571Z","repository":{"id":141332338,"uuid":"50228671","full_name":"pouu69/Backbone.PagerCollection","owner":"pouu69","description":"we using pagination inside backbone.collection extends","archived":false,"fork":false,"pushed_at":"2016-02-25T07:14:54.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T11:22:51.318Z","etag":null,"topics":["backbone","extends","library","pagination"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pouu69.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-23T07:33:48.000Z","updated_at":"2016-01-23T07:35:06.000Z","dependencies_parsed_at":"2023-05-09T16:00:46.072Z","dependency_job_id":null,"html_url":"https://github.com/pouu69/Backbone.PagerCollection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouu69%2FBackbone.PagerCollection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouu69%2FBackbone.PagerCollection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouu69%2FBackbone.PagerCollection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pouu69%2FBackbone.PagerCollection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pouu69","download_url":"https://codeload.github.com/pouu69/Backbone.PagerCollection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244156089,"owners_count":20407474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backbone","extends","library","pagination"],"created_at":"2024-11-24T09:17:54.101Z","updated_at":"2025-03-18T04:29:32.545Z","avatar_url":"https://github.com/pouu69.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backbone.PagerCollection\n- Bakcbone pagination \n- We can using colleciton for pagination\n\n\ni can't write english\n\n----------------------------------------------\n\n# Required\n- API 내에 요청한 collection 에 대한 total count가 필요 하다. parse 메서드에서 API에서 주는 DATA Propertie에 맞게 수정 하면 된다.\n````\nparse : function(response){\n  this._count = response._count; // _count 를 각자에 맞게 수정\n  ............\n  return response.data; // 이것 또한 자신의 API가 주는 json 구조에 맞게 바꾸어 return 해준다.\n}\n````\n\n# How to way\n- 최초 collection.initPagination({...}) 을 수행한다.\n- initPagination 파라미터는 Obecjt type으로써 다음과 같은 propertie가 있다.\n  * nbPerPaage : 각 페이지당 showing할 아이템 갯수\n  * totalPages : 총 페이지 갯수\n  * totalCount : collection의 총 model 갯수\n  * currentPage : 현재 페이지\n  * startPage : 시작 페이지\n  * paginationEnabled : 페이지네이션 가능 여부 \n\n- 그 후에 3가지 방법으로 페이지 네이션을 진행한다.\n````\ncollection.getNextPage(options){};\ncollection.getPrevPage(options){};\ncollection.getPage(pageNum, options){};\n\n// options 는 기본적인 backbone fetch save delete에서 사용했던 options들이다, ( callback 형식 )\n// getNextPage, getPrevPage로 이전,다음 페이지로 이동이 가능하며, \n// getPage로는 원하는 페이지번호로 이동할 수 있다.\n````\n\n- 또한 이전,다음 페이지로 이동이 가능한지 에 대한 체크가 된다.\n\n````\n  collection.hasNextPage();\n  collection.hasPrevPage();\n````\n- initPagination 을 통해 설정한 현재 collection의 페이지네이션 config확인 가능\n````\n  colleciton.state // object로 설정한 config 확인 가능\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouu69%2Fbackbone.pagercollection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpouu69%2Fbackbone.pagercollection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpouu69%2Fbackbone.pagercollection/lists"}