|Modifier and Type||Method and Description|
Process a drop of one or more nodes on a TreeGrid folder.
HandlerRegistration addFolderDropHandler(FolderDropHandler handler)
The default behavior
is to simply delegate to the
thus, the correct way to perform a programmatic folder drop, with all the built-in behaviors described below, is to
If this is a self-drop, nodes are simply reordered. An "update" operation will be
submitted to update the
parentId field of the moved
For a drop from another widget,
transferDragData() is called which, depending on the
dragDataAction specified on the source widget, may either remove the source nodes from the original list
dragDataAction:"move") or just provide a copy to this tree (
either case the new row(s) appear in the
folder at the
index specified by the arguments of the
If this grid is databound, the new nodes will be added to the dataset by calling
DataSource.addData(). Further, if the new nodes were dragged from another
databound component, and
addDropValues is true,
getDropValues will be called for every item being
As a special case, if the
sourceWidget is also databound and a
foreignKey relationship is declared from the
sourceWidget's DataSource to this TreeGrid's DataSource, the interaction will be treated as a "drag
recategorization" use case such as files being placed in folders, employees being assigned to teams, etc. "update"
DSRequests will be submitted that change the foreignKey field in the dropped records to point to the tree folder that
was the target of the drop. In this case no change will be made to the Tree data as such, only to the dropped records.
For multi-record drops, Queuing is automatically used to combine all DSRequests into a single HTTP Request (see QuickStart Guide, Server Framework chapter). This allows the server to persist all changes caused by the drop in a single transaction (and this is automatically done when using the built-in server DataSources with Power Edition and above).
If these default persistence behaviors are undesirable, use
event.cancel(), then implement
your own behavior, typically by using grid.updateData() or addData() to add new records.
NOTE: the records
you receive in this event are the actual Records from the source component. Use
DataSource.copyRecords() to create a copy before modifying the records
or using them with updateData() or addData().
handler- the folderDrop handler
HandlerRegistrationused to remove this handler