jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
96 lines (84 loc) • 4.24 kB
HTML
<html lang="en">
<head>
<meta name="keywords" content="jqxSortable, jQuery Sortable, jQWidgets, Default Functionality" />
<meta name="description" content="jqxSortable is a plug-in..." />
<title id='Description'>This demo demonstrates how to connect multiple elements used jqxSortable plugin.</title>
<link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../../jqwidgets/globalization/globalize.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxsortable.js"></script>
<script type="text/javascript" src="../../../scripts/demos.js"></script>
<style>
.sortable {
margin: 2px;
padding: 5px;
width: 200px;
border: lightblue solid 1px;
}
.sortable-container{;
float: left;
width: 220px;
}
.sortable-container span {
font-weight: bold;
}
.sortable div {
border-radius: 5px;
padding: 5px;
background-color: white;
color: black;
cursor: pointer;
border: 1px solid transparent;
}
.sortable div:hover {
border: 1px solid #356AA0;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne"];
var lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth"];
var titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager", "Sales Representative", "Sales Representative", "Inside Sales Coordinator", "Sales Representative"];
var sortableList1 = '',
sortableList2 = '',
firstNamesLength = firstNames.length,
firstNamesHalf = Math.floor(firstNamesLength/2);
for (var i = 0; i < firstNames.length; i++) {
var imgurl = '../../../images/' + firstNames[i].toLowerCase() + '.png';
var img = '<img height="50" width="40" src="' + imgurl + '"/>';
var element = '<div><table style="min-width: 130px;"><tr><td style="width: 40px;" rowspan="2">' + img + '</td><td>' + firstNames[i] + " " + lastNames[i] + '</td></tr><tr><td>' + titles[i] + '</td></tr></table></div>';
if (i < firstNamesHalf) {
sortableList1 = sortableList1 + element;
} else {
sortableList2 = sortableList2 + element;
}
}
$("#sortable1").html(sortableList1);
$("#sortable2").html(sortableList2);
$("#sortable1, #sortable2").jqxSortable({
connectWith: ".sortable",
opacity: 0.5,
});
});
</script>
</head>
<body>
<div class="sortable-container">
<span>Team A</span>
<div id="sortable1" class="sortable"></div>
</div>
<div class="sortable-container">
<span>Team B</span>
<div id="sortable2" class="sortable"></div>
</div>
<div style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a>
</div>
</body>
</html>