{"action":"opened","issue":{"url":"https://api.github.com/repos/DataTables/Plugins/issues/188","labels_url":"https://api.github.com/repos/DataTables/Plugins/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/DataTables/Plugins/issues/188/comments","events_url":"https://api.github.com/repos/DataTables/Plugins/issues/188/events","html_url":"https://github.com/DataTables/Plugins/issues/188","id":71741950,"number":188,"title":"pageResize Plugin - Divide by Zero when Datatable hidden","user":{"login":"williamdenton","id":7498040,"avatar_url":"https://avatars.githubusercontent.com/u/7498040?v=3","gravatar_id":"","url":"https://api.github.com/users/williamdenton","html_url":"https://github.com/williamdenton","followers_url":"https://api.github.com/users/williamdenton/followers","following_url":"https://api.github.com/users/williamdenton/following{/other_user}","gists_url":"https://api.github.com/users/williamdenton/gists{/gist_id}","starred_url":"https://api.github.com/users/williamdenton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williamdenton/subscriptions","organizations_url":"https://api.github.com/users/williamdenton/orgs","repos_url":"https://api.github.com/users/williamdenton/repos","events_url":"https://api.github.com/users/williamdenton/events{/privacy}","received_events_url":"https://api.github.com/users/williamdenton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-29T00:13:25Z","updated_at":"2015-04-29T00:13:25Z","closed_at":null,"body":"When the datatable is created in a hidden div and then shown, the pageResize plugin fails and breaks normal display of grid.\r\n\r\n    var rowHeight = $( 'tr', settings.body ).eq(0).height();\r\n\r\nrowHeight is zero when the datatable parent container is `display:none`\r\n\r\n    var drawRows = Math.floor( availableHeight / rowHeight );\r\n\r\nthis check could check for `NaN` so normal grid functionality is not broken\r\n\r\n\t\tif ( drawRows !== dt.page.len() ) {\r\n\t\t\tdt.page.len( drawRows ).draw();\r\n\t\t}\r\n\r\nReproduced in Chrome.\r\n"}}