EasyUI Forum

General Category => Bug Report => Topic started by: asd1245dss on April 09, 2014, 05:49:16 PM



Title: How to set dialog while dragging dialog can not use proxy but directly drag the
Post by: asd1245dss on April 09, 2014, 05:49:16 PM
i want to directly drag the dialog,so i set proxy=null,but it doesn't work


Title: Re: How to set dialog while dragging dialog can not use proxy but directly drag the
Post by: stworthy on April 09, 2014, 07:14:13 PM
No 'proxy' property is available in dialog plugin. To drag a dialog with no proxy, you need to customize the draggable on this dialog. The better way to solve this issue is to extend a new method.
Code:
<script>
$.extend($.fn.window.methods, {
dragWithNoProxy: function(jq){
return jq.each(function(){
var w = $(this);
w.window('window').draggable({
onStartDrag: function(){},
onDrag: function(e){
w.window('move', {
left: e.data.left,
top: e.data.top
});
},
onStopDrag: function(e){
w.window('move', {
left: e.data.left,
top: e.data.top
});
}
})
});
}
});
</script>

Now try to call 'dragWithNoProxy' method on a dialog.
Code:
$('#dlg').dialog('dragWithNoProxy');