EasyUI Forum
September 13, 2025, 02:04:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Drag and drop BETWEEN two treegrids (but not within)  (Read 6374 times)
alastairwalker
Newbie
*
Posts: 14


View Profile Email
« on: August 19, 2014, 07:09:16 AM »

I have an application in which I need to be able to drag and drop BETWEEN two treegrids, but not permit drag and drop WITHIN either treegrid.

To explore this, I started off with the extension example (treegrid-dnd.zip), and extended it so that I have two treegrids (tg1, and tg2, using data1, and data2).
 (See the attached modified html script).

Now, if I use

   $(function(){$('#tg1').treegrid({onDragEnter: function(targetRow,sourceRow){
            var opts = $(this).treegrid('options');
            var tr = opts.finder.getTr(this, targetRow[opts.idField]);
            if (tr.attr('node-id')){return false;}}})});

This disables tg1 from d and d'ing within Treegrid 1, but allows d and d into treegrid2. (This is expected behaviour)

But if I add

   $(function(){$('#tg2').treegrid({onDragEnter: function(targetRow,sourceRow){
            var opts = $(this).treegrid('options');
            var tr = opts.finder.getTr(this, targetRow[opts.idField]);
            if (tr.attr('node-id')){return false;}}})});

Then d and d is not allowed either within each treegrid, or between the treegrids.

So, clearly, there must be some parameter that is incorrect, but I am not smart enough in js to spot it yet.

Any help on this will be really appreciated!

Alastair

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!