desandro / masonry

:love_hotel: Cascading grid layout plugin
https://masonry.desandro.com
16.41k stars 2.11k forks source link

ngx-masonry in angular not keeping the order of data #1094

Closed ssaamu closed 5 years ago

ssaamu commented 5 years ago

In angular 7 when using NgxMasonryModule(ngx-masonry - ver 1.1.2) though the masonry is working it's not coming as per order of data. html code: <ngx-masonry class="row" [useImagesLoaded]="true" [updateLayout]="newsArray" [options]="{ itemSelector: '.masonry-item', transitionDuration: '0.8s', horizontalOrder: true, percentPosition: true, columnWidth: '.masonry-item' }"> <ngxMasonryItem class="col-12 col-sm-6 col-md-4 masonry-item" ngFor="let newsitem of newsArray"> <a class="news__link link-target-blank" href="{{ newsitem.news_link }}" ngIf="newsitem.news_link_ext == 'yes'" target="_blank"> <figure class="news__image {{ newsitem.news_category == 'Video' ? 'news__video' : '' }}" *ngIf="newsitem.news_image != ''">

{{ newsitem.news_title }}
                        </figure>

                        <span class="news_date"><span>{{ newsitem.news_category }}</span> | {{ newsitem.news_date }}</span>

                        <h3>{{ newsitem.news_title }} <i class="icon-link-out"></i></h3>
                    </a>
                </ngxMasonryItem>
            </ngx-masonry>

in newsArray data is coming fine as news3, news2, news1 according to ID desc but in view sometimes the data is coming correct but sometimes it's all jumbled. How to solve this ?

desandro commented 5 years ago

Sorry, I do not maintain ngx-masonry. You'll have to open a seperate issue there: https://github.com/gethinoakes/ngx-masonry/issues