{"action":"created","issue":{"url":"https://api.github.com/repos/primefaces/primeng/issues/1046","repository_url":"https://api.github.com/repos/primefaces/primeng","labels_url":"https://api.github.com/repos/primefaces/primeng/issues/1046/labels{/name}","comments_url":"https://api.github.com/repos/primefaces/primeng/issues/1046/comments","events_url":"https://api.github.com/repos/primefaces/primeng/issues/1046/events","html_url":"https://github.com/primefaces/primeng/issues/1046","id":181879353,"number":1046,"title":"DataTable: feature to set page number programatically using DataTable Component","user":{"login":"vaibhavcodegeek","id":21243421,"avatar_url":"https://avatars.githubusercontent.com/u/21243421?v=3","gravatar_id":"","url":"https://api.github.com/users/vaibhavcodegeek","html_url":"https://github.com/vaibhavcodegeek","followers_url":"https://api.github.com/users/vaibhavcodegeek/followers","following_url":"https://api.github.com/users/vaibhavcodegeek/following{/other_user}","gists_url":"https://api.github.com/users/vaibhavcodegeek/gists{/gist_id}","starred_url":"https://api.github.com/users/vaibhavcodegeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vaibhavcodegeek/subscriptions","organizations_url":"https://api.github.com/users/vaibhavcodegeek/orgs","repos_url":"https://api.github.com/users/vaibhavcodegeek/repos","events_url":"https://api.github.com/users/vaibhavcodegeek/events{/privacy}","received_events_url":"https://api.github.com/users/vaibhavcodegeek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-09T10:22:36Z","updated_at":"2016-11-29T07:32:48Z","closed_at":null,"body":"Hi,\n\nWe have a CRUD application, user selects data to edit from a PrimeNG datatable. Datatable uses pagination. Datatable is reset on add/edit to clear filters, sorting etc.\n\nLets say, user selects a record on page number 5 and edits the same. After edit when datatable is rendered again then pagination is reset to page number 1.\n\nWe need to set the page number as per selected record but not able to find any method on DataTable Component to perform the same.\n\nPlease look into this.\n"},"comment":{"url":"https://api.github.com/repos/primefaces/primeng/issues/comments/263497318","html_url":"https://github.com/primefaces/primeng/issues/1046#issuecomment-263497318","issue_url":"https://api.github.com/repos/primefaces/primeng/issues/1046","id":263497318,"user":{"login":"garthmason","id":19699511,"avatar_url":"https://avatars.githubusercontent.com/u/19699511?v=3","gravatar_id":"","url":"https://api.github.com/users/garthmason","html_url":"https://github.com/garthmason","followers_url":"https://api.github.com/users/garthmason/followers","following_url":"https://api.github.com/users/garthmason/following{/other_user}","gists_url":"https://api.github.com/users/garthmason/gists{/gist_id}","starred_url":"https://api.github.com/users/garthmason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garthmason/subscriptions","organizations_url":"https://api.github.com/users/garthmason/orgs","repos_url":"https://api.github.com/users/garthmason/repos","events_url":"https://api.github.com/users/garthmason/events{/privacy}","received_events_url":"https://api.github.com/users/garthmason/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T07:32:48Z","updated_at":"2016-11-29T07:32:48Z","body":"We also wanted to do this, and are working around it by getting the datatable as a ViewChild and then forcing the paginator to set the page we want (see below):\r\n\r\n`@ViewChild(DataTable) dataTable: DataTable;`\r\n\r\n... and \r\n\r\n```\r\nsetCurrentPage(n: number) {\r\n    let paging = {\r\n      first: ((n - 1) * this.dataTable.rows),\r\n      rows: this.dataTable.rows\r\n    };\r\n    this.dataTable.paginate(paging);\r\n  }\r\n```"}}
{"actor":{"display_login":"garthmason"}}