{"action":"created","issue":{"url":"https://api.github.com/repos/gregnb/mui-datatables/issues/184","repository_url":"https://api.github.com/repos/gregnb/mui-datatables","labels_url":"https://api.github.com/repos/gregnb/mui-datatables/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/gregnb/mui-datatables/issues/184/comments","events_url":"https://api.github.com/repos/gregnb/mui-datatables/issues/184/events","html_url":"https://github.com/gregnb/mui-datatables/issues/184","id":356559582,"node_id":"MDU6SXNzdWUzNTY1NTk1ODI=","number":184,"title":"Server Side Support doesn't work well with selecting","user":{"login":"kirstenland","id":40798648,"node_id":"MDQ6VXNlcjQwNzk4NjQ4","avatar_url":"https://avatars1.githubusercontent.com/u/40798648?v=4","gravatar_id":"","url":"https://api.github.com/users/kirstenland","html_url":"https://github.com/kirstenland","followers_url":"https://api.github.com/users/kirstenland/followers","following_url":"https://api.github.com/users/kirstenland/following{/other_user}","gists_url":"https://api.github.com/users/kirstenland/gists{/gist_id}","starred_url":"https://api.github.com/users/kirstenland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirstenland/subscriptions","organizations_url":"https://api.github.com/users/kirstenland/orgs","repos_url":"https://api.github.com/users/kirstenland/repos","events_url":"https://api.github.com/users/kirstenland/events{/privacy}","received_events_url":"https://api.github.com/users/kirstenland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-03T16:26:26Z","updated_at":"2018-09-04T00:39:38Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n\r\nWhen using server side support, you get problems when trying to select items on the second page.\r\n\r\n<!--\r\n    Thank you very much for contributing to MUI-datatables by creating an issue! ❤️\r\n-->\r\n\r\n## Expected Behavior\r\n<!---\r\n    If you're describing a bug, tell us what should happen.\r\n    If you're suggesting a change/improvement, tell us how it should work.\r\n-->\r\n\r\nWhen using Server Side support (different for without server side support):\r\n\r\nWhen you click on the select all button, all rows on that page should be selected. [important]\r\n\r\nWhen you try to select a row, the index given to handleRowSelect etc. should give the index for its position on the current page, not for where it would be if the previous pages were loaded. [less important, but probably the correct behaviour]\r\n\r\n## Current Behavior\r\n<!---\r\n    If describing a bug, tell us what happens instead of the expected behavior.\r\n    If suggesting a change/improvement, explain the difference from current behavior.\r\n-->\r\n\r\nWhen using Server Side support:\r\n\r\nWhen you click on the select all button, the rows don't seem to be selected (as in the check boxes are not full), but the handleRowSelect is given indices for its position on the current page.\r\n\r\nWhen you try to select a row, the index given to handleRowSelect etc. gives the index for its position for where it would be if the previous pages were loaded.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!---\r\n    Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.\r\n    Include code to reproduce, if relevant (which it most likely is).\r\n-->\r\n\r\nhttps://codesandbox.io/s/xvnq8456pq\r\n\r\nThe link above is the server side example provided by MUI-datatables, with the option selectableRows: true added.\r\n\r\n1. Go to the second page of data\r\n2. Click the select all button at the top\r\n3. Note how nothing has been selected\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment with which you experienced the bug. -->\r\n\r\n| Tech         | Version |\r\n|--------------|---------|\r\n| MUI-datatables  | 2.0.0-beta-24 |\r\n\r\n## Fix?\r\nAdding the line \r\n`if (this.props.options.serverSide) return index;`\r\nat the beginning of the getRowIndex function in MUIDataTableBody appears to fix the problem for me."},"comment":{"url":"https://api.github.com/repos/gregnb/mui-datatables/issues/comments/418210350","html_url":"https://github.com/gregnb/mui-datatables/issues/184#issuecomment-418210350","issue_url":"https://api.github.com/repos/gregnb/mui-datatables/issues/184","id":418210350,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODIxMDM1MA==","user":{"login":"gregnb","id":19170080,"node_id":"MDQ6VXNlcjE5MTcwMDgw","avatar_url":"https://avatars0.githubusercontent.com/u/19170080?v=4","gravatar_id":"","url":"https://api.github.com/users/gregnb","html_url":"https://github.com/gregnb","followers_url":"https://api.github.com/users/gregnb/followers","following_url":"https://api.github.com/users/gregnb/following{/other_user}","gists_url":"https://api.github.com/users/gregnb/gists{/gist_id}","starred_url":"https://api.github.com/users/gregnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregnb/subscriptions","organizations_url":"https://api.github.com/users/gregnb/orgs","repos_url":"https://api.github.com/users/gregnb/repos","events_url":"https://api.github.com/users/gregnb/events{/privacy}","received_events_url":"https://api.github.com/users/gregnb/received_events","type":"User","site_admin":false},"created_at":"2018-09-04T00:39:38Z","updated_at":"2018-09-04T00:39:38Z","author_association":"OWNER","body":"Should be good in the latest version"}}
{"actor":{"display_login":"gregnb"}}