s-yadav / angulargrid

Pinterest like responsive masonry grid system for angular
MIT License
277 stars 105 forks source link

Sorting cards #146

Open gilbar opened 6 years ago

gilbar commented 6 years ago

Hi,

I've started using this module and it's great!

However, I'm having two issues (which are more or less the same), for some reason the option "direction" ltor or rtol doesn't seem to take any effect on the outcome... So I guess that I don't quite understand what it really does...

Furthermore, I'm trying to order the cards based on some property I have per each card and was using the suggested function

//sort images by something (lets say likes) $scope.sortByLikes = function () { $scope.imageList.sort(function (a, b) { return b.likes - a.likes; }); } which I adjusted to work based on the property. However, I'm getting somewhat weird ordering... the first card is drawn at the left-most column while I'd like it to be the right-most column (direction property...). second, the order is not well preserved... it gets lost after the 3rd card or so...

what am I missing?