JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script>
var data = {"total":28,"rows":[
{"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"},
{"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"},
{"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"},
{"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"}
]};
$(function(){
var dg1 = $('#dg1');
var dg2 = $('#dg2');
dg1.datagrid('getPanel').find('.datagrid-view').draggable({
revert:true,
deltaX:10,
deltaY:10,
proxy:function(source){
var p = $('<div style="z-index:9999999999999;background:#fff;color:red;font-weight:bold;border:1px solid red;"></div>').appendTo('body');
p.html(dg1.datagrid('getSelections').length + ' items');
p.hide();
return p;
},
onDrag: function(e) {
var x1=e.pageX,y1=e.pageY,x2=e.data.startX,y2=e.data.startY;
var d = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
if (d>3){ // when drag a little distance, show the proxy object
$(this).draggable('proxy').show();
}
}
});
dg2.datagrid('getPanel').find('.datagrid-view').droppable({
accept: '.datagrid-view',
onDrop:function(e, source){
var dg1 = $(source).children('table');
var dg2 = $(this).children('table');
var rows = dg1.datagrid('getSelections');
for(var i=0; i<rows.length; i++){
dg2.datagrid('appendRow', rows[i]);
}
while(rows.length){
var row = rows.pop();
var index = dg1.datagrid('getRowIndex',...