{"action":"created","issue":{"url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/740","repository_url":"https://api.github.com/repos/swimlane/ngx-datatable","labels_url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/740/labels{/name}","comments_url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/740/comments","events_url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/740/events","html_url":"https://github.com/swimlane/ngx-datatable/pull/740","id":226741328,"number":740,"title":"Add server-side scrolling demo","user":{"login":"dinvlad","id":137337,"avatar_url":"https://avatars2.githubusercontent.com/u/137337?v=4","gravatar_id":"","url":"https://api.github.com/users/dinvlad","html_url":"https://github.com/dinvlad","followers_url":"https://api.github.com/users/dinvlad/followers","following_url":"https://api.github.com/users/dinvlad/following{/other_user}","gists_url":"https://api.github.com/users/dinvlad/gists{/gist_id}","starred_url":"https://api.github.com/users/dinvlad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinvlad/subscriptions","organizations_url":"https://api.github.com/users/dinvlad/orgs","repos_url":"https://api.github.com/users/dinvlad/repos","events_url":"https://api.github.com/users/dinvlad/events{/privacy}","received_events_url":"https://api.github.com/users/dinvlad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-05-06T05:37:46Z","updated_at":"2018-02-08T01:59:58Z","closed_at":"2017-05-12T16:41:57Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/swimlane/ngx-datatable/pulls/740","html_url":"https://github.com/swimlane/ngx-datatable/pull/740","diff_url":"https://github.com/swimlane/ngx-datatable/pull/740.diff","patch_url":"https://github.com/swimlane/ngx-datatable/pull/740.patch"},"body":"This demo combines scrolling and server-side paging\r\nto enable \"infinite\" scrolling with results fetched from\r\nthe server as the user scrolls down the list.\r\n\r\nWe always fetch the next page such that it is obvious\r\nfrom the vertical scrollbar when there are more results.\r\nThis approach also helps us avoid explicit pixel calculation logic,\r\ninstead relying only on (page) events.\r\n\r\nOnce loaded, the results are never removed from the cache,\r\nwhich increases memory consumption over time.\r\nThis is a minor hindrance, since in a typical scenario\r\n(e.g. generation of the list in response to a \"search\" request),\r\nwe expect the most relevant results to appear at the top,\r\nwith progressively more \"stale\" results at the bottom,\r\nso that a typical user won't scroll too far (e.g. beyond 100-200 results).\r\nIt is also well-known that such search queries consume\r\nprogressively more server resources and are not efficient\r\nbeyond e.g. 1000 results.\r\n\r\n**What kind of change does this PR introduce?** (check one with \"x\")\r\n- [ ] Bugfix\r\n- [ ] Feature\r\n- [ ] Code style update (formatting, local variables)\r\n- [ ] Refactoring (no functional changes, no api changes)\r\n- [ ] Build related changes\r\n- [ ] CI related changes\r\n- [x] Demo\r\n\r\n**What is the current behavior?** (You can also link to an open issue here)\r\nThere are separate demos for virtual scrolling (when all of the results are fetched in advance)\r\nand server-side paging (without vertical scrolling).\r\n\r\n**What is the new behavior?**\r\nWe combine these together to enable \"infinite\" server-side scrolling.\r\n\r\n**Does this PR introduce a breaking change?** (check one with \"x\")\r\n- [ ] Yes\r\n- [x] No\r\n\r\n**Other information**:\r\nThis PR was requested by @amcdnl in https://github.com/swimlane/ngx-datatable/issues/611#issuecomment-299452014"},"comment":{"url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/comments/363977454","html_url":"https://github.com/swimlane/ngx-datatable/pull/740#issuecomment-363977454","issue_url":"https://api.github.com/repos/swimlane/ngx-datatable/issues/740","id":363977454,"user":{"login":"Matmo10","id":2548215,"avatar_url":"https://avatars3.githubusercontent.com/u/2548215?v=4","gravatar_id":"","url":"https://api.github.com/users/Matmo10","html_url":"https://github.com/Matmo10","followers_url":"https://api.github.com/users/Matmo10/followers","following_url":"https://api.github.com/users/Matmo10/following{/other_user}","gists_url":"https://api.github.com/users/Matmo10/gists{/gist_id}","starred_url":"https://api.github.com/users/Matmo10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matmo10/subscriptions","organizations_url":"https://api.github.com/users/Matmo10/orgs","repos_url":"https://api.github.com/users/Matmo10/repos","events_url":"https://api.github.com/users/Matmo10/events{/privacy}","received_events_url":"https://api.github.com/users/Matmo10/received_events","type":"User","site_admin":false},"created_at":"2018-02-08T01:59:58Z","updated_at":"2018-02-08T01:59:58Z","author_association":"NONE","body":"Ended up here after reading various threads asking about infinite scrolling (with data that comes from a server for each \"page\"). \r\n\r\nFirst, I think it would be very helpful to clearly explain somewhere the difference(s) between \"Scrolling server-side\" and \"virtual server-side\".  I'm sure these terms are totally obvious to some people, but it's (probably) unclear to some people, myself included. \r\n\r\nSecond, the [virtual server side](https://swimlane.github.io/ngx-datatable/#virtual-paging) demo is currently broken (`Error: query at index -1 failed: Fenwick tree array not initialized.`), which makes it even harder to distinguish between the two. \r\n\r\nI would imagine my use case is fairly common: when I approach the bottom of the table, I'd like to get some event that would allow me to go manually fetch the next page and add the rows to my [rows] input.  Looking at the source for the virtual server side pagination example, it seems like thats what I want, but any usage of `[externalPaging]=\"true\"` causes the same error that the demo app is experiencing. \r\n\r\nTL;DR - The demo / code for \"virtual paging server side\" is broken. \r\n"}}
{"actor":{"display_login":"Matmo10"}}