Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have three listbox i.e. listbox1 , listbox2 , listbox3 . I am moving items from listbox1 to listbox2 vise-versa using buttons . And moving items from listbox2 to listbox3 using drag drop. When i m applying draggable funtion and droppable function on listbox2, its working fine on drag and drop part. but then i losses control to select the option of listbox2. That's why items are not moving on button click from listbox2 to listbox1.

Code:
JavaScript
$('#Listbox2 option').draggable({
          helper: function () {
              return $('<div>' + $(this).text() + '</div>');
          },
          appendTo: 'body',
          cancel: 'input,textarea,button'
      });

      $('.dropSelect').droppable({
          drop: function (ev, ui) {
              ui.draggable.clone().appendTo(this);
          }
      });


XML
 @Html.ListBox("ListBox1", new MultiSelectList(Model.AvailableFields, "Value", "Text"), htmlAttributes: new { @data_results_width = 170, @style = "width:540px; height:300px ;size=30" })
@Html.ListBox("ListBox2", new MultiSelectList(Model.RequestedColumns, "Value", "Text"), htmlAttributes: new {  @data_results_width = 170, @style = "width:540px; height:300px ; size=30" })
@Html.ListBox("ListBox3", new MultiSelectList("", "Value", "Text"), htmlAttributes: new { @class = "dropSelect", @data_results_width = 170, @style = "width:400px; height:250px ; size=30  " })
Posted
Updated 29-Dec-15 1:32am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900