Moving items between Lists




</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Moving items between Lists</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<link rel="stylesheet" type="text/css" href="../common/demo_style.css"/>
	<script>
		var myList1, myList2;
		function doOnLoad() {
			myList1 = new dhtmlXList({
				container:"data_container1",
				template:"<span class='dhx_strong'>#name#</span>#address# <br/><span class='dhx_light'>#city#</span>",
				type:{ height:80 }
			});
			myList1.load("../common/list.xml");

			myList2 = new dhtmlXList({
				container:"data_container2",
				template:"<span class='dhx_strong'>#name#</span>#address# <br/><span class='dhx_light'>#city#</span>",
				type:{ height:80 }
			});
		}
	</script>
</head>
<body onload="doOnLoad();">
	<h1>Moving items between Lists</h1>
	<table border="0" cellspacing="5" cellpadding="5">
		<tr>
			<td>
				<div id="data_container1" class="list_demo_samples"></div><br>
			</td>
			<td>
				<input type="button" name="" value="move ->" onclick="myList1.move(myList1.getSelected(), 0, myList2)"><br>
				<input type="button" name="" value="<- move" onclick="myList2.move(myList2.getSelected(), 0, myList1)">
			</td>
			<td>
				<div id="data_container2" class="list_demo_samples"></div><br>
			</td>
		</tr>
	</table>
</body>
</html>

Documentation

Check documentation to learn how to use the components and easily implement them in your applications.