troubleshooting Question

How to refresh sortable list

Avatar of dmarnlo
dmarnlo asked on
JavaScript
1 Comment1 Solution378 ViewsLast Modified:
I have two sortable lists.  The top one, listA is ordered and the bottom one, listB is unordered.
When I remove an item from listA and place it in listB, the ordered listA doesn't refresh itself.  What code can I insert  that refreshes listA?

Dale


<script type="text/javascript">
$(document).ready(function() {
      $("#listA").sortable({
      connectWith: ['#listB']
      });

      $("#listB").sortable({
      connectWith: ['#listA'],
      receive: function(event, ui) {
      var candidateName= ui.item.text();
      process: processList() ;      
                        
                  },
      remove: function(event, ui) {
      var candidateName= ui.item.text();
      }
      });
});  //end of document.ready

</script>
</head>

<cfquery name="players" datasource="#request.dns#">
select first_name, Last_name from playertable where team_number = "#session.myteam#" and active = 'A'
</cfquery>

<cfquery name="getteamname" datasource="#request.dns#">
select TeamName from team where TeamNumber = "#session.myteam#"
</cfquery>

    <div id="leftColumn">
      <h3>Batting Order</h3>
      <ol id="listA">
      
      <cfoutput query="players">
      <li start=1>#players.first_name# #players.last_name#</li>
    </cfoutput>
            
      </ol>
</div>

<div id="rightColumn">
      <h3>Substitutes</h3>
      <ul id="listB">

      </ul>
</div>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros