0

I am using Dragula with Angular7 and dragula is not updating the list sorting even after drag and drop event successfully emitted. Here, is my code :

dragula.view.html

<div class="portlet-content doc-portlet">
<div dragula="one-bag" [(dragulaModel)]="fileList" (dragulaModelChange)="fileList = $event">
    <div class="elementline " *ngFor="let item of fileList">
        <div class="extra-pages-portlet-content">
            <div class="thumb-box left-col">
                <a href="{{item.file_url}}{{item.file}}" target="_blank">
                    <img [src]="item.complete_url" height="100%" width="100%">
                </a>
            </div>
            <div class="right-col thumb-info">
                <div class="icon-row">
                    <div class="icon" style="float:right;">
                        <span style="cursor:grabbing; float:right;">
                            <img src="../../assets/images/move.png" height="16" width="16" class="iconDelete-update">
                        </span>
                    </div>
                </div>
                <div class="text-and-input-field">
                  <span class="text-detail-portlet" style="float:left;">Seconden: </span>
                  <div class="input-field">
                      <input type="text" [(ngModel)]="item.slide_duration" class="text-right-Detail-user" placeholder="-" style="width:100%; text-align:right;">
                  </div>
                </div>
            </div>
        </div>
    </div>
</div>

dragula.component.ts

dragulaService.setOptions('one-bag', {})
  dragulaService.drop.subscribe((value:any) => {

    var counter = 0;
     for(var j=0; j < this.fileList.length;j++) {
      this.fileList[j].narrowcasting_slide_order = counter;
        counter++;
     } 
});  

I am dragging and dropping the items in the list, but dragula is not updating the list sorting order. Can somebody provide me any solution on this?

Nishi Gaba
  • 661
  • 8
  • 28

0 Answers0