{"action":"created","issue":{"url":"https://api.github.com/repos/mleibman/SlickGrid/issues/897","repository_url":"https://api.github.com/repos/mleibman/SlickGrid","labels_url":"https://api.github.com/repos/mleibman/SlickGrid/issues/897/labels{/name}","comments_url":"https://api.github.com/repos/mleibman/SlickGrid/issues/897/comments","events_url":"https://api.github.com/repos/mleibman/SlickGrid/issues/897/events","html_url":"https://github.com/mleibman/SlickGrid/pull/897","id":28923977,"number":897,"title":"Blazing Fast Column Width Update (with passing tests)","user":{"login":"SimplGy","id":548809,"avatar_url":"https://avatars.githubusercontent.com/u/548809?v=3","gravatar_id":"","url":"https://api.github.com/users/SimplGy","html_url":"https://github.com/SimplGy","followers_url":"https://api.github.com/users/SimplGy/followers","following_url":"https://api.github.com/users/SimplGy/following{/other_user}","gists_url":"https://api.github.com/users/SimplGy/gists{/gist_id}","starred_url":"https://api.github.com/users/SimplGy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimplGy/subscriptions","organizations_url":"https://api.github.com/users/SimplGy/orgs","repos_url":"https://api.github.com/users/SimplGy/repos","events_url":"https://api.github.com/users/SimplGy/events{/privacy}","received_events_url":"https://api.github.com/users/SimplGy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":29,"created_at":"2014-03-06T23:09:14Z","updated_at":"2016-11-03T18:33:15Z","closed_at":"2015-11-18T17:02:08Z","pull_request":{"url":"https://api.github.com/repos/mleibman/SlickGrid/pulls/897","html_url":"https://github.com/mleibman/SlickGrid/pull/897","diff_url":"https://github.com/mleibman/SlickGrid/pull/897.diff","patch_url":"https://github.com/mleibman/SlickGrid/pull/897.patch"},"body":"New method `grid.updateColumnWidths(columnDefinitions)` improves performance _dramatically_ when all you need to do is adjust widths. I built it so that the whole grid isn't redrawn, only the styles are updated and the width on the header cells is modified.\n\nPerformance on my machine went from `76ms` to `2ms`, so there's a huge gain. Also, because the grid is not re-rendered in this model, all of the custom things folks (heh, me) might add to the column headers don't need to be re-drawn/bound.\n\nI added a passing test for the traditional `setColumns` approach, and a passing test for the new `updateColumnWidths` approach. The test prints timing so you can see for yourself.\n\nI use many of the grid features, but not all of them, so it's possible (likely?) I have missed something and this surgical resize option does not work if that feature is enabled. If so, I'd be happy to add a test case for it and fix it.\n\nIn terms of arguing for its broad applicability, I have collected the following evidence. I think this new method would help anyone trying to autofit columns to content (this is my use case, in fact.)\n#### Prior requests/discussion/issues:\n\nhttp://stackoverflow.com/questions/6794656/how-do-i-autosize-the-column-in-slickgrid\nhttps://groups.google.com/forum/#!topic/slickgrid/dYtmwhfFCTw\nhttps://groups.google.com/forum/#!topic/slickgrid/TmvDUzaKfPk\nhttps://github.com/mleibman/SlickGrid/issues/305\nhttp://stackoverflow.com/questions/15200574/slickgrid-column-width-should-automatically-get-resized-according-to-widest-row\nhttps://github.com/mleibman/SlickGrid/issues/568\nhttps://github.com/mleibman/SlickGrid/pull/733\nhttp://stackoverflow.com/questions/12071844/is-it-possible-to-change-width-of-a-column-in-slickgrid-programatically\n\nThere's also a little google groups post I made attempting to get your thoughts on the idea:\nhttps://groups.google.com/forum/#!topic/slickgrid/BBB-Qhg7TvU\n"},"comment":{"url":"https://api.github.com/repos/mleibman/SlickGrid/issues/comments/258233984","html_url":"https://github.com/mleibman/SlickGrid/pull/897#issuecomment-258233984","issue_url":"https://api.github.com/repos/mleibman/SlickGrid/issues/897","id":258233984,"user":{"login":"mpetkov","id":8858458,"avatar_url":"https://avatars.githubusercontent.com/u/8858458?v=3","gravatar_id":"","url":"https://api.github.com/users/mpetkov","html_url":"https://github.com/mpetkov","followers_url":"https://api.github.com/users/mpetkov/followers","following_url":"https://api.github.com/users/mpetkov/following{/other_user}","gists_url":"https://api.github.com/users/mpetkov/gists{/gist_id}","starred_url":"https://api.github.com/users/mpetkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpetkov/subscriptions","organizations_url":"https://api.github.com/users/mpetkov/orgs","repos_url":"https://api.github.com/users/mpetkov/repos","events_url":"https://api.github.com/users/mpetkov/events{/privacy}","received_events_url":"https://api.github.com/users/mpetkov/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T18:33:15Z","updated_at":"2016-11-03T18:33:15Z","body":"Did this method, updateColumnWidths, ever get pushed to this repo?  I  am asking because I don't see it in the master branch."}}
{"actor":{"display_login":"mpetkov"}}