function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Deepu Gupta 29Deepu Gupta 29 

is it possible to enable to add drag drop feature in visualforce page

Hi,
I have a req in which i need to enable drag drop feature in visualforce page.I have searched for muliple solutions to achieve this req.While searching went in this link too but there component is missing.http://salesforcelexis.blogspot.in/2012/05/drag-drop-option-in-custom-visualforce.html.
Could any one please suggest that how can i achieve this req?
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. Some idea you will get
1) https://developer.salesforce.com/forums/?id=906F0000000BPWkIAO
 
<apex:page >
    <link rel="stylesheet" href="/resources/demos/style.css"/>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"/>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
       
     <style>
        #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
        #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
        #sortable li span { position: absolute; margin-left: -1.3em; }
     </style>

<script>

$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
});

window.getValues = function() {
    $.each($('#sortable').find('li'), function() {
        alert($(this).text());
    });
}
</script>


<ul id="sortable">
  <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 1</li>
  <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 2</li>
  <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 3</li>
</ul>

 <center><button type="button" onclick="getValues()">Get Lines</button></center>
    
</apex:page>


Let us know if that will help you

Thanks
Amit Chaudhary
Deepu Gupta 29Deepu Gupta 29
Hi Amit,
Thanks for your reply.but is there controller associated with it meaning that it is just VF page i am getting this list items which you mentioned under unordered list.sorry if my understanding is wrong.but this code is usable for drag drop feature.could you please explain?