EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on November 14, 2014, 08:36:05 PM



Title: drag from datagrid frozen column to normal column [solved]
Post by: devnull on November 14, 2014, 08:36:05 PM
I have almost finished a design for dragging and dropping cell contents and needed to make 2 of the columns frozen, one of them is the source column where the items get dragged from.

I thought this would be simple, but unfortunately it is not and the frozen columns seems to interfere with the drag and drop process.

When I drag an item from the frozen column, it gets hidden behind the normal columns as you drag it and disappears.

I have tried setting the z-index of the item being dragged but that makes no difference.

How can this be fixed ?


Title: Re: drag from datagrid frozen column to normal column
Post by: stworthy on November 14, 2014, 11:32:16 PM
When drag a cell from the frozen columns, the dragging proxy should be append to <body>. Please refer to the following code.
Code:
$('#dg').datagrid({
onLoadSuccess: function(){
var dc = $(this).data('datagrid').dc;
dc.body1.find('div.datagrid-cell').draggable({
revert: true,
proxy: function(source){
var p = $('<div></div>').appendTo('body');
p.html($(source).html());
p.attr('class', $(source).attr('class'));
p.attr('style', $(source).attr('style'));
p.css('border', '1px solid #ccc');
return p;
}
})
}
})


Title: Re: drag from datagrid frozen column to normal column
Post by: devnull on November 14, 2014, 11:58:19 PM
Thanks so much, that has fixed it.