EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Pierre on December 05, 2016, 01:46:24 AM



Title: Datagrid onBeforeDrop, how to cancel drop?
Post by: Pierre on December 05, 2016, 01:46:24 AM
Hello All,
I'm using datagrid dragDrop extension and question is:
how to avoid drop if some conditions are not OK?

On onBeforeDrop, I try to use code like this:
Code:
function			onBeforeDrop_my(targetRow,sourceRow,point)
{
    $.get('xxxxxx', function(t_data){
      // my code to send request to server
      alert('result');
    },'json');
 
}

I need to wait for result from server and then, based on server's answer, I can call
return false (to deny drop)
Currently, drop is executed before I see answer from server.

Any idea how to solve this?
Thank you.


Title: Re: Datagrid onBeforeDrop, how to cancel drop?
Post by: stworthy on December 06, 2016, 02:13:42 AM
The 'onBeforeDrop' event fires immediately, you can not delay it.