Open In App

jQWidgets jqxDragDrop initFeedback Property

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxDragDrop is used to represent a jQuery drag and drop widget that is used to make any DOM element draggable. It can be used in combination with many widgets like jqxTree, jqxGrid, jqxListBox and etc.

The initFeedback property is used to set or return the callback which is executing when the feedback is created. It accepts function type value and its default value is null.

Syntax:

  • Set the initFeedback property.

    $('selector').jqxDragDrop({ initFeedback: function(feedback) { 
        feedback.width(300); 
    } });
  • Return the initFeedback property.

    var initFeedback = $('selector').jqxDragDrop('initFeedback');

 

Linked Files: Download jQWidgets from the link. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdragdrop.js”></script>

Example: The below example illustrates the jqxDragDrop initFeedback property in jQWidgets.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" href=
"jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" 
            src="scripts/jquery-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqx-all.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxdragdrop.js">
    </script>
</head>
  
<body class='default'>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
  
        <h3>
            jQWidgets jqxDragDrop initFeedback Property
        </h3>
  
        <div style="width: 120px; height: 120px; 
            border: 1px solid black; 
            background-color: green;" id="divID">
  
            <div style="display: flex;
                justify-content: center;
                align-items: center;
                height: 100%;">
                Drag me
            </div>
        </div>
    </center>
  
    <script type="text/javascript">
        $(document).ready(function() {
            $("#divID").jqxDragDrop({
                initFeedback: function (feedback) {
                    feedback.css({
                        background: 'blue',
                        color: 'white',
                    });
                    feedback.text('Div is dragging');  
                }
            });
        });
    </script>
</body>
</html>


Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdragdrop/jquery-dragdrop-api.htm



Last Updated : 26 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads