Class IgxDropDirective

Implements

  • OnInit
  • OnDestroy

Constructors

Properties

dropChannel: string | number | string[] | number[]

A property that provides a way for igxDrag and igxDrop to be linked through channels. It accepts single value or an array of values and evaluates then using strict equality.

<div igxDrag [dragChannel]="'odd'">
<span>95</span>
</div>
<div igxDrop [dropChannel]="['odd', 'irrational']">
<span>Numbers drop area!</span>
</div>

Memberof

IgxDropDirective

dropped: EventEmitter<IDropDroppedEventArgs> = ...

Event triggered when dragged element is dropped in the area of the element. Since the igxDrop has default logic that appends the dropped element as a child, it can be canceled here. To cancel the default logic the cancel property of the event needs to be set to true.

<div class="cageArea" igxDrop (dropped)="dragDrop()" (igxDragEnter)="onDragCageEnter()" (igxDragLeave)="onDragCageLeave()">
</div>
public dragDrop(){
alert("A draggable element has been dropped in the chip area!");
}

Memberof

IgxDropDirective

element: ElementRef<any>
enter: EventEmitter<IDropBaseEventArgs> = ...

Event triggered when dragged element enters the area of the element.

<div class="cageArea" igxDrop (enter)="dragEnter()" (igxDragEnter)="onDragCageEnter()" (igxDragLeave)="onDragCageLeave()">
</div>
public dragEnter(){
alert("A draggable element has entered the chip area!");
}

Memberof

IgxDropDirective

leave: EventEmitter<IDropBaseEventArgs> = ...

Event triggered when dragged element leaves the area of the element.

<div class="cageArea" igxDrop (leave)="dragLeave()" (igxDragEnter)="onDragCageEnter()" (igxDragLeave)="onDragCageLeave()">
</div>
public dragLeave(){
alert("A draggable element has left the chip area!");
}

Memberof

IgxDropDirective

over: EventEmitter<IDropBaseEventArgs> = ...

Event triggered when dragged element enters the area of the element.

<div class="cageArea" igxDrop (enter)="dragEnter()" (igxDragEnter)="onDragCageEnter()" (igxDragLeave)="onDragCageLeave()">
</div>
public dragEnter(){
alert("A draggable element has entered the chip area!");
}

Memberof

IgxDropDirective

Accessors

  • get dropStrategy(): any
  • Returns any

  • set dropStrategy(classRef): void
  • Sets a drop strategy type that will be executed when an IgxDrag element is released inside the current drop area. The provided strategies are:

    • IgxDefaultDropStrategy - This is the default base strategy and it doesn't perform any actions.
    • IgxAppendDropStrategy - Appends the dropped element to last position as a direct child to the igxDrop.
    • IgxPrependDropStrategy - Prepends the dropped element to first position as a direct child to the igxDrop.
    • IgxInsertDropStrategy - If the dropped element is released above a child element of the igxDrop, it will be inserted at that position. Otherwise the dropped element will be appended if released outside any child of the igxDrop.
    <div igxDrag>
    <span>DragMe</span>
    </div>
    <div igxDrop [dropStrategy]="myDropStrategy">
    <span>Numbers drop area!</span>
    </div>
    import { IgxAppendDropStrategy } from 'igniteui-angular';

    export class App {
    public myDropStrategy = IgxAppendDropStrategy;
    }

    Memberof

    IgxDropDirective

    Parameters

    • classRef: any

    Returns void