Sortable two-lists : Sortable « Scriptaculous « JavaScript DHTML






Sortable two-lists

 
<!--
Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->

<!-- revised from scriptaculous-js-1.8.2 demo code  -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>script.aculo.us sortable functional test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="scriptaculous-js-1.8.2/lib/prototype.js" type="text/javascript"></script>
  <script src="scriptaculous-js-1.8.2/src/scriptaculous.js" type="text/javascript"></script>
  <script src="scriptaculous-js-1.8.2/src/unittest.js" type="text/javascript"></script>
  <link rel="stylesheet" href="../test.css" type="text/css" />
  <style type="text/css" media="screen">
    ul { height: 100px; border:1px dotted #888; }
  </style>
</head>
<body>
<h1>script.aculo.us Sortable two-lists w/ dropOnEmpty functional test file</h1>

<ul id="thelist1">
<li id="thelist1_1">Hey there! I'm item#1/1</li>
<li id="thelist1_2">Hey there! I'm item#1/2</li>
<li id="thelist1_3">Hey there! I'm item#1/3</li>
</ul>

<ul id="thelist2">
</ul>

<script type="text/javascript" language="javascript" charset="utf-8">

  Sortable.create('thelist1',{containment:['thelist1','thelist2'], dropOnEmpty:true});
  Sortable.create('thelist2',{containment:['thelist1','thelist2'], dropOnEmpty:true});

</script>

<a href="#" onclick="alert(Sortable.serialize('thelist1'));return false;">Serialize sortable1</a>
<a href="#" onclick="alert(Sortable.serialize('thelist2'));return false;">Serialize sortable2</a>

<div id="debug"></div>

</body>
</html>

   
  








Related examples in the same category

1.Sortable with ghosting effects
2.Sortabled list with handlers
3.Sortable list updated event
4.drag and drop to sort
5.Sort and reorder the ordered list
6.Sortable onChange event and onUpdate event
7.Horizontally Sortable
8.Sortable is Not just for lists
9.Two sortable groups