Drag and Drop Issue

UI Components for Angular
Post Reply
Ayyappan
Posts: 6
Joined: 14 Feb 2019, 14:45

14 Feb 2019, 15:04

I would to like to drag and drop in (up and down) and (left to right) order.Ex.

I have a list of div's in leftside and rightside. I would to like to drag a leftside div and drop in rightside. And i can also drag a leftside div and drop a leftside div(up and down order). Please assist me.

For left-side:

Code: Select all

<div class="colum-12 fileds-container drag-column" *ngFor="let section of sections" id="left-side-section-{{section.id}}" #dragAndDropDiv pDraggable="sections" (onDragStart)="dragStart($event,section)" (onDragEnd)="dragEnd($event)">
                    <div class="colum-12 drop-fields">
                        {{section.name}}
                    </div>                    
                </div>
For right-side:

Code: Select all

<div class="row m-row--no-padding align-items-center">
                            <div class="col">
                                <h3 class="m-widget1__title">{{section.id}}</h3>
                                <span class="m-widget1__desc">{{section.name}}</span>
                            </div>
                            <button id="deleteSection" (click)="deleteSection(section, section_index)" title="{{l('Delete')}}" class="btn btn-outline-danger m-btn m-btn--icon m-btn--icon-only m-btn--pill" href="javascript:;">
                                <i class="fa fa-times"></i>
                            </button>
                        </div>

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

19 Feb 2019, 16:22

Ayyappan wrote:
14 Feb 2019, 15:04
I would to like to drag and drop in (up and down) and (left to right) order.Ex.

I have a list of div's in leftside and rightside. I would to like to drag a leftside div and drop in rightside. And i can also drag a leftside div and drop a leftside div(up and down order). Please assist me.

For left-side:

Code: Select all

<div class="colum-12 fileds-container drag-column" *ngFor="let section of sections" id="left-side-section-{{section.id}}" #dragAndDropDiv pDraggable="sections" (onDragStart)="dragStart($event,section)" (onDragEnd)="dragEnd($event)">
                    <div class="colum-12 drop-fields">
                        {{section.name}}
                    </div>                    
                </div>
For right-side:

Code: Select all

<div class="row m-row--no-padding align-items-center">
                            <div class="col">
                                <h3 class="m-widget1__title">{{section.id}}</h3>
                                <span class="m-widget1__desc">{{section.name}}</span>
                            </div>
                            <button id="deleteSection" (click)="deleteSection(section, section_index)" title="{{l('Delete')}}" class="btn btn-outline-danger m-btn m-btn--icon m-btn--icon-only m-btn--pill" href="javascript:;">
                                <i class="fa fa-times"></i>
                            </button>
                        </div>
Hi,
Here is example for you;
https://stackblitz.com/edit/github-2unz ... onent.html

Best Regards.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests