{"action":"created","issue":{"url":"https://api.github.com/repos/handsontable/handsontable/issues/3192","repository_url":"https://api.github.com/repos/handsontable/handsontable","labels_url":"https://api.github.com/repos/handsontable/handsontable/issues/3192/labels{/name}","comments_url":"https://api.github.com/repos/handsontable/handsontable/issues/3192/comments","events_url":"https://api.github.com/repos/handsontable/handsontable/issues/3192/events","html_url":"https://github.com/handsontable/handsontable/issues/3192","id":131402837,"number":3192,"title":"Issues with viewportRowRenderingOffset:auto while implementing custom expand collapse logic","user":{"login":"samsonkhisty","id":3254606,"avatar_url":"https://avatars.githubusercontent.com/u/3254606?v=3","gravatar_id":"","url":"https://api.github.com/users/samsonkhisty","html_url":"https://github.com/samsonkhisty","followers_url":"https://api.github.com/users/samsonkhisty/followers","following_url":"https://api.github.com/users/samsonkhisty/following{/other_user}","gists_url":"https://api.github.com/users/samsonkhisty/gists{/gist_id}","starred_url":"https://api.github.com/users/samsonkhisty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samsonkhisty/subscriptions","organizations_url":"https://api.github.com/users/samsonkhisty/orgs","repos_url":"https://api.github.com/users/samsonkhisty/repos","events_url":"https://api.github.com/users/samsonkhisty/events{/privacy}","received_events_url":"https://api.github.com/users/samsonkhisty/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Assistance%20needed","name":"Assistance needed","color":"0052cc"},{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Priority:%20normal","name":"Priority: normal","color":"fbca04"},{"url":"https://api.github.com/repos/handsontable/handsontable/labels/Question","name":"Question","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-02-04T16:34:46Z","updated_at":"2016-02-12T11:54:16Z","closed_at":null,"body":"Hi there again, \r\n\r\nI'm trying to implement my expand collapse logic like so\r\n\r\n![screen shot 2016-02-04 at 11 15 36 am](https://cloud.githubusercontent.com/assets/3254606/12821270/ab45793a-cb30-11e5-8220-3a62269447f1.png)\r\n\r\nI've added a click event handler on the icons which will simply update a field `hidden_children` to the parent and `hidden` to all the children below and call `render` and I have a custom rendered that will change the icon on the parent and adds class `hide` to the children with `hidden:true`\r\n\r\nI've got the bulk of the feature working, however ran into some issues: \r\n\r\n* If I leave the `viewportRowRenderingOffset: auto` as default, and collapse some rows in my view such that the rows which are normally outside the viewport are now into view. They are not rendered yet. \r\n\r\n* My next issue is again with  `viewportRowRenderingOffset: auto`, It introduces some weird scroll behavior on cell clicks if some data is collapsed. Not sure how to debug into this: \r\n![viewportrowrenderingoffset](https://cloud.githubusercontent.com/assets/3254606/12821909/7cf15646-cb33-11e5-9bed-55796fd75bba.gif)\r\n\r\n* If I change to `viewportRowRenderingOffset: myData.length`, this works as intended however, for a table with huge rows there is lag in collapsing and expanding. It seems slow. \r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/handsontable/handsontable/issues/comments/183294044","html_url":"https://github.com/handsontable/handsontable/issues/3192#issuecomment-183294044","issue_url":"https://api.github.com/repos/handsontable/handsontable/issues/3192","id":183294044,"user":{"login":"budnix","id":571316,"avatar_url":"https://avatars.githubusercontent.com/u/571316?v=3","gravatar_id":"","url":"https://api.github.com/users/budnix","html_url":"https://github.com/budnix","followers_url":"https://api.github.com/users/budnix/followers","following_url":"https://api.github.com/users/budnix/following{/other_user}","gists_url":"https://api.github.com/users/budnix/gists{/gist_id}","starred_url":"https://api.github.com/users/budnix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/budnix/subscriptions","organizations_url":"https://api.github.com/users/budnix/orgs","repos_url":"https://api.github.com/users/budnix/repos","events_url":"https://api.github.com/users/budnix/events{/privacy}","received_events_url":"https://api.github.com/users/budnix/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T11:54:16Z","updated_at":"2016-02-12T11:54:16Z","body":"Hi @samsonkhisty, Great job you have done! About the first screen it looks very cool. Issue you described is related with your technique you use to hide rows. It is not recommend to hide a lot of rows via css. In this case table calculates rows height even for this hidden rows. It reads height of hidden rows from cache and tries to fill whole viewport. The case is this row is hidden from DOM so that its why there is a gap.\r\n\r\nFor hiding rows you can use `modifyRow` hook and there put your logic. [In updated demo](https://jsfiddle.net/nvd2q1nw/24/) I hide rows indexes 2, 3 and rows from 10 to 14.\r\n\r\nIf you want to you can try to similar functionality which is [trimRows](http://docs.handsontable.com/pro/demo-trimming-rows.html). This plugin is part of Handsontable PRO."}}