Drag and Drop between Grids
dhtmlxGrid supports drag-n-drop not only within one grid, but between grids as well. Check out this functionality in the sample below.
</> Source
<!DOCTYPE html>
<html>
<head>
<title>Drag and Drop between Grids</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>
<script>
var myGrid, treeGrid;
function doOnLoad(){
myGrid = new dhtmlXGridObject('gridbox3');
myGrid.selMultiRows = true;
myGrid.setImagePath("../../../codebase/imgs/");
myGrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
myGrid.setInitWidths("80,150,100,80,80,80,80,100");
myGrid.setColAlign("right,left,left,right,center,left,center,center");
myGrid.setColTypes("dyn,ed,ed,price,ch,coro,ra,ro");
myGrid.setColSorting("int,str,str,int,str,str,str,date");
myGrid.enableDragAndDrop(true);
myGrid.enableAutoWidth(true);
myGrid.init();
myGrid.load("../common/grid.xml");
//
treeGrid = new dhtmlXGridObject('gridbox2');
treeGrid.selMultiRows = true;
treeGrid.setImagePath("../../../codebase/imgs/");
treeGrid.setHeader("Alpha,Betta");
treeGrid.setInitWidths("80,170");
treeGrid.setColAlign("right,left");
treeGrid.setColTypes("ed,ed");
treeGrid.setColSorting("int,str");
treeGrid.enableDragAndDrop(true);
treeGrid.init();
treeGrid.load("../common/dynscroll.xml");
}
</script>
</head>
<body onload="doOnLoad()">
<h1>Drag and Drop between Grids</h1>
<p>
dhtmlxGrid supports drag-n-drop not only within one grid, but between grids as well. Check out this functionality in the sample below.
</p>
<table width="800px">
<tr>
<td>
<div id="gridbox2" style="width:270px;height:350px;background-color:white;"></div>
</td>
<td>
<div id="gridbox3" style="width:767px;height:350px;background-color:white;"></div>
</td>
</tr>
</table>
</body>
</html>
Documentation
Check documentation to learn how to use the components and easily implement them in your applications.