{"action":"created","issue":{"url":"https://api.github.com/repos/desandro/masonry/issues/882","repository_url":"https://api.github.com/repos/desandro/masonry","labels_url":"https://api.github.com/repos/desandro/masonry/issues/882/labels{/name}","comments_url":"https://api.github.com/repos/desandro/masonry/issues/882/comments","events_url":"https://api.github.com/repos/desandro/masonry/issues/882/events","html_url":"https://github.com/desandro/masonry/issues/882","id":168672435,"number":882,"title":"Initiate Masonry grid - After infinite scroll and parametric search","user":{"login":"higraf","id":20775360,"avatar_url":"https://avatars.githubusercontent.com/u/20775360?v=3","gravatar_id":"","url":"https://api.github.com/users/higraf","html_url":"https://github.com/higraf","followers_url":"https://api.github.com/users/higraf/followers","following_url":"https://api.github.com/users/higraf/following{/other_user}","gists_url":"https://api.github.com/users/higraf/gists{/gist_id}","starred_url":"https://api.github.com/users/higraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/higraf/subscriptions","organizations_url":"https://api.github.com/users/higraf/orgs","repos_url":"https://api.github.com/users/higraf/repos","events_url":"https://api.github.com/users/higraf/events{/privacy}","received_events_url":"https://api.github.com/users/higraf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/desandro/masonry/labels/support%20request","name":"support request","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-01T15:22:41Z","updated_at":"2016-08-08T11:07:44Z","closed_at":"2016-08-08T11:07:43Z","body":"This is my first post at github, so please be patient. \r\n\r\nThere is a problem between AJAX and Masonry grid. Masonry grid is simple not being initiated at the right moments. \r\n\r\nBefore scrolling or using the parametric search to go to a specific category, it works very well. \r\n\r\nSample site can be found [here](http://www.unicornart.no/kunst/).\r\n\r\n**When scrolling**\r\nThe next columns are being added above (or behind) the older ones. Giving almost the same output as unloaded images which makes [images overlapping](http://masonry.desandro.com/layout.html#imagesloaded). \r\n\r\n**When using parametric search**\r\nThe Masonry is not being fired correctly. Meaning it does not work at all.\r\n\r\nPlease see sample site above.\r\n\r\nBoth scrolling and parametric search is delivered by [Toolset](https://wp-types.com/). They have a good system with making it very easy to load JS at specific times. Both after the AJAX Pagination has been completed, and also before, during and after Parametric search. Since the problem is after scrolling, and after the results for Parametric search has been updated, I would like to initiate the Masonry grid at this very moment.\r\n\r\nThe easiest example is when the scrolling is done, or pagination as it's also called.\r\n\r\nI used `reloadItems` as I guessed would be correct. Please correct me if I am wrong.\r\n\r\n```\r\njQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {\r\n  $container.masonry('reloadItems')\r\n});\r\n```\r\n\r\nIn my theory it would reload all the items when scrolling, so they would be arranged properly. But it changes nothing.\r\n\r\nI also tried to reload the items when the parametric search results has been updated. \r\n\r\n```\r\njQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {\r\n\t $container.masonry('reloadItems')\t\r\n});\r\n```\r\n\r\nBut this did not work either.\r\n\r\nThe Masonry is also added in the footer by using [one of the methodes](http://masonry.desandro.com/methods.html). \r\n\r\n```\r\n(function( $ ) {\r\n\t\"use strict\";\r\n\tvar $container = $('.masonry-container');\r\n\t$container.imagesLoaded( function () {\r\n\t\t$container.masonry({\r\n\t\t\tcolumnWidth: '.col-md-3',\r\n\t\t\tpercentPosition: true,\r\n\t\t\titemSelector: '.col-md-3'\r\n\t\t});\r\n\t});\r\n})(jQuery);\r\n```\r\n\r\nDo you have any ideas? "},"comment":{"url":"https://api.github.com/repos/desandro/masonry/issues/comments/238206132","html_url":"https://github.com/desandro/masonry/issues/882#issuecomment-238206132","issue_url":"https://api.github.com/repos/desandro/masonry/issues/882","id":238206132,"user":{"login":"higraf","id":20775360,"avatar_url":"https://avatars.githubusercontent.com/u/20775360?v=3","gravatar_id":"","url":"https://api.github.com/users/higraf","html_url":"https://github.com/higraf","followers_url":"https://api.github.com/users/higraf/followers","following_url":"https://api.github.com/users/higraf/following{/other_user}","gists_url":"https://api.github.com/users/higraf/gists{/gist_id}","starred_url":"https://api.github.com/users/higraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/higraf/subscriptions","organizations_url":"https://api.github.com/users/higraf/orgs","repos_url":"https://api.github.com/users/higraf/repos","events_url":"https://api.github.com/users/higraf/events{/privacy}","received_events_url":"https://api.github.com/users/higraf/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T11:07:43Z","updated_at":"2016-08-08T11:07:43Z","body":"Once again you are correct.\r\n\r\nThank you very much. Problem solved."}}
{"actor":{"display_login":"higraf"}}