Search
DragDropEventArgs.dropTarget Property
See Also
 






Gets an object, containing data about the target of the operation.

Namespace: MindFusion.Common.UI
File: EventArgs.js

 Syntax

JavaScript  Copy Code

get dropTarget() {}

 Property Value

Object. An object, containing data about the target of the operation.

 Example

The following code handles the dragDrop event of a ListView class. Event data is provided through the DragDropEventArgs class.

JavaScript  Copy Code

var ui = MindFusion.UI;

// Create a new ListView control.
var list1 = new ui.ListView();

// Add event handler
list1.dragDrop.addEventListener(listDragDrop);

function listDragDrop(sender, args)
{
 var refItem = args.dropTarget.item;
 var refIndex = sender.items.indexOfItem(refItem);
 if (args.dropTarget.position == 1) refIndex += 1;

 var itemIndex = sender.items.indexOfItem(args.dragItem);

 if ((itemIndex < 5) && (refIndex > 5)) args.cancel = true;
 if ((itemIndex > 5) && (refIndex <= 5)) args.cancel = true;
}

 See Also