EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Pierre on April 18, 2016, 04:25:50 AM



Title: [SOLVED] DragDrop from other treegrid
Post by: Pierre on April 18, 2016, 04:25:50 AM
Hello all
I have many datagrid's and treegrid's - how to accept drop only from specified treegrid?
For Example I have #aa tregrid and #bb treegrid - I want to allow only drop from aa to bb.
I just tried to search the forum but it does not work - it looks like formum search is corrupted.
Thank you.


Title: Re: DragDrop from other treegrid
Post by: stworthy on April 18, 2016, 09:02:02 AM
Please look at this topic:
http://www.jeasyui.com/forum/index.php?topic=5430.0

or use the 'dropAccept' property to constrain the dropping nodes.
Code:
<div class="aa">
<table id="aa" class="easyui-treegrid">
...
</table>
</div>
<table id="bb" class="easyui-treegrid"
data-options="
dropAccept: '.aa tr[node-id]',
onLoadSuccess: function(row){
$(this).treegrid('enableDnd', row?row.id:null);
}
">
</table>


Title: Re: DragDrop from other treegrid
Post by: Pierre on April 18, 2016, 09:52:40 AM
Great thank you - key is in this line:
dropAccept: '.aa tr[node-id]'
because I didn't know what is meant by "selector"..
Thank's again.