The sfDragDrop is a directive that adds drag-and-drop functionality to an HTML element. Using this directive you can drag one or several files over a specified HTML element. When a drop event occurs a delegate is called. The sfDragDrop directive is defined in a module with the same name: sfDragDrop.
sfDragDrop
HTML
The sfDragDrop directive exposes the following attributes:
sf-template-html
sf-data-transfer-callback
dataTransferObject
The sfDragDrop directive adds the following CSS classes to the HTML host element:
sf-Drag-start
sf-Drag-over
The following example demonstrates how to add a drag-and-drop directive in a widget designer's view.
To enable AngularJs to link the sfDragDrop directive in your custom designer view, you must load the script of the directive and add a dependency to the module. Perform the following:
DesignerView.YourView.json
JSON
designerview-yourview.js
The code above is called when a drop event occurs. As a result, an alert displays the name of the first file that was dropped in the HTML element hosting the sfDragDrop directive.
DesignerView.YourView.cshtml
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important