tristanguigue / angular-dynamic-layout

A lightweight AngularJS dynamic grid layout
http://tristanguigue.github.io/angular-dynamic-layout/
78 stars 35 forks source link

Added the possibility to use a fixed colWidth #38

Closed antony-k1208 closed 8 years ago

antony-k1208 commented 8 years ago

When using a fixed grid it is necessary to use a fixed colWidth. Especially when filling the cards array dynamically with objects and random template usages. With that it can happen, that you have no .col1 element inside your cards array and the automatic calculation will result in a wrong min colWidth which will then lead to "Image too large" errors.

tristanguigue commented 8 years ago

I'm not sure I see the use case here, if there are no items to be displayed then this is not a problem. If there are items to display it will pick up the smallest width to set as column width. The width of the items are entirely depends on the CSS. Could you provide an example? Thanks

antony-k1208 commented 8 years ago

As with masonry it is sometimes necessary than you can specify the colWidth. I had an example where i was filling my cards array dynamically. I was using 4 templates, for col1 - col4 layouts. In one case i only had 2 elements in my array, one col3 and one col4 template and i got this "Item too large" errors and it didn't aligned anything at all. After specifying a fixed colWidth all errors disappeared.

tristanguigue commented 8 years ago

Ok that make sense see comments on implementation