aboutsummaryrefslogtreecommitdiffstats
path: root/demos/sortable
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-12-30 14:38:15 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-12-30 14:38:15 +0000
commit858d5daad90e6fc0f0c72dbf9b73e1e353179a82 (patch)
treec77f7e37458d50d613e0fc335d2f00e632ad1b46 /demos/sortable
parent5dd4dc208bb45bc55cbdabd3e5d6eaf376334b23 (diff)
downloadjquery-ui-858d5daad90e6fc0f0c72dbf9b73e1e353179a82.tar.gz
jquery-ui-858d5daad90e6fc0f0c72dbf9b73e1e353179a82.zip
demo: sortables: connectWith, dropOnEmpty, excluding items
Diffstat (limited to 'demos/sortable')
-rw-r--r--demos/sortable/connectwith.html41
-rw-r--r--demos/sortable/droponempty.html51
-rw-r--r--demos/sortable/index.html4
-rw-r--r--demos/sortable/items.html49
4 files changed, 144 insertions, 1 deletions
diff --git a/demos/sortable/connectwith.html b/demos/sortable/connectwith.html
new file mode 100644
index 000000000..3744cb61a
--- /dev/null
+++ b/demos/sortable/connectwith.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Sortable - Connected lists</title>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
+ <style type="text/css">
+ ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
+ li { margin: 3px; padding: 2px; width: 120px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("ul").sortable({
+ connectWith: ['ul']
+ });
+ });
+ </script>
+</head>
+<body>
+
+<ul>
+ <li class="ui-state-default">Item 1</li>
+ <li class="ui-state-default">Item 2</li>
+ <li class="ui-state-default">Item 3</li>
+ <li class="ui-state-default">Item 4</li>
+ <li class="ui-state-default">Item 5</li>
+</ul>
+
+<ul>
+ <li class="ui-state-highlight">Item 1</li>
+ <li class="ui-state-highlight">Item 2</li>
+ <li class="ui-state-highlight">Item 3</li>
+ <li class="ui-state-highlight">Item 4</li>
+ <li class="ui-state-highlight">Item 5</li>
+</ul>
+
+</body>
+</html>
diff --git a/demos/sortable/droponempty.html b/demos/sortable/droponempty.html
new file mode 100644
index 000000000..1a0202c22
--- /dev/null
+++ b/demos/sortable/droponempty.html
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Sortable - Dropping on empty lists</title>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
+ <style type="text/css">
+ ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 133px;}
+ li { margin: 3px; padding: 2px; width: 120px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("ul.droptrue").sortable({
+ connectWith: ['ul']
+ });
+
+ $("ul.dropfalse").sortable({
+ connectWith: ['ul'],
+ dropOnEmpty: false
+ });
+ });
+ </script>
+</head>
+<body>
+
+<ul class='droptrue'>
+ <li class="ui-state-default">Can be dropped..</li>
+ <li class="ui-state-default">..on an empty list</li>
+ <li class="ui-state-default">Item 3</li>
+ <li class="ui-state-default">Item 4</li>
+ <li class="ui-state-default">Item 5</li>
+</ul>
+
+<ul class='dropfalse'>
+ <li class="ui-state-highlight">Cannot be dropped..</li>
+ <li class="ui-state-highlight">..on an empty list</li>
+ <li class="ui-state-highlight">Item 3</li>
+ <li class="ui-state-highlight">Item 4</li>
+ <li class="ui-state-highlight">Item 5</li>
+</ul>
+
+<ul class='droptrue'>
+</ul>
+
+<br clear="both" />
+
+</body>
+</html>
diff --git a/demos/sortable/index.html b/demos/sortable/index.html
index 92de67934..f8ff3fb28 100644
--- a/demos/sortable/index.html
+++ b/demos/sortable/index.html
@@ -13,7 +13,9 @@
<li><a href="floating.html">Floating</a></li>
<li><a href="placeholder.html">Placeholder</a></li>
<li><a href="delaydistance.html">Delay / Distance</a></li>
-
+ <li><a href="items.html">Excluding items</a></li>
+ <li><a href="connectwith.html">Connecting two lists</a></li>
+ <li><a href="droponempty.html">Dropping on empty lists</a></li>
</ul>
</div>
diff --git a/demos/sortable/items.html b/demos/sortable/items.html
new file mode 100644
index 000000000..810daf554
--- /dev/null
+++ b/demos/sortable/items.html
@@ -0,0 +1,49 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Sortable - Items</title>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
+ <script type="text/javascript" src="../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
+ <style type="text/css">
+ ul { list-style-type: none; margin: 0; padding: 0; }
+ li { margin: 3px; padding: 2px; }
+ </style>
+ <script type="text/javascript">
+ $(function() {
+ $("ul:eq(0)").sortable({
+ items: 'li:not(.ui-state-disabled)'
+ });
+
+ $("ul:eq(1)").sortable({
+ cancel: '.ui-state-disabled'
+ });
+ });
+ </script>
+</head>
+<body>
+
+<p>Completely exclude items from the sorting logic using the 'items' option</p>
+
+<ul>
+ <li class="ui-state-default">Item 1</li>
+ <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
+ <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
+ <li class="ui-state-default">Item 4</li>
+ <li class="ui-state-default">Item 5</li>
+</ul>
+
+<p>Keep the items as valid targets, but non-draggable, using the 'cancel' option</p>
+
+<ul>
+ <li class="ui-state-default">Item 1</li>
+ <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
+ <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
+ <li class="ui-state-default">Item 4</li>
+ <li class="ui-state-default">Item 5</li>
+</ul>
+
+</body>
+</html>