-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auto reload packery on collection change #10
Comments
This is addressed in the README file. https://github.com/SunGard-Labs/angular-packery#a-note-on-ng-include-and-draggability |
@joshuahiggins Not sure what you're talking about but this is not addressed anywhere. The simple snippet I posted above does not automatically refresh the tiles when I change the |
I'm sorry, I misread your original comment. What are you attempting to accomplish? Items added via an ng-repeat are added as they are built. They have already been collected by Packery individually. I'm not sure what recollecting the items would accomplish? |
Thanks for prompt response. Ok so imagine I want to filter that collection so I remove or add some objects. In the spirit of angular, packery should automatically filter the tiles when I change this data-binded collection. Think http://stackexchange.com/sites See the categories at the top, you can click to filter? I'm trying to accomplish this effect. |
Oh! I understand what you mean now. That's a great idea. I'll definitely poke around with that for v1.1. |
This actually somewhat relates to issue #3, allowing for destroying packed items. After those items are removed, the whole layout would need to be refreshed, just as with filtering items. |
Awesome thank you! When do you plan to release 1.1? |
No set date, but there's a few features that we plan to add for the v1.1 release: https://github.com/SunGard-Labs/angular-packery/milestones/1.1 |
+1 would definitely like this feature |
+1 Working on a site right now and was looking for this same functionality. The idea would be to be able to type into a filter input and when the items are filtered/unfiltered, packery would refresh the layout. |
Does anybody have a temporary workaround for this ? |
I haven't been able to test this yet, but I do believe that the returned Packery object can be added as a data object on the wrapper element via Angular's jqLite. Referencing this stored data should allow access to Packery methods directly. And yes, this is most definitely a required feature for v1.1. I was hoping to have that finished up by the end of the month, but it may be a week or two into March now. |
I'm not sure I understand, do you mean it's possible to do something like <packery id="container" data-packery="packeryObject"> Where data-packery is an attribute (in this case which one?) and that it could bind the directive's packery object to $scope.packeryObject ? Sorry if I misunderstood your explanation. Could you illustrate a bit more please. |
may I please get updated ETA? I'm launching soon therefore debating whether to wait for this fix or revert to using packery at the jquery level. |
Sorry, I don't have an ETA now. With Packery / Draggabilly updating versions and introducing breaking changes, we realized we need to work backwards to introduce a TDD method to mitigate future issues. We'll be introducing testing and bugfixes to support the latest Packery / Draggabilly / jQuery UI builds before new functionality. |
Re-implement cards without packery; revisit when ng-packery supports auto-reloading packery elements SunGard-Labs/angular-packery#10
+1 on this, please. The 'fit' method would be a groovy bonus, as well. |
I've created a pull request to resolve the unpackery object function. |
@dot-louis a workaround im currently using is to call layout() from http://packery.metafizzy.co/methods.html#layout manually (f.e. in your angular-controller with a custom filter) you can retrieve the packery object via the $rootScope: $rootScope.$on('packeryInstantiated', function (event, args) {
pckry = args;
}); and then call layout() on it when needed: pckry.layout(); |
I'm using the workaround mentioned by Lotbert as well. I have not been able to get the packery object that joshuahiggins mentioned is available on the packery container element. A couple notes:
|
Can you please add functionality to auto-reload packery (I believe that would be "reloadItems" method) when the ng-repeat collection changes (in the spirit of angular)?
The text was updated successfully, but these errors were encountered: