Jump to content

Drag & Drop rows between 2 UniDbGrids Test Case


Recommended Posts

Hi , i would like to drag & drop rows between two grids , 

 

here is the code i used , it seems i forgot something , if some one could help me to fix it please 

//in first grid:

function beforeInit(sender, config)
{

    
  config.listeners = {
                      plugins: {
                                 ptype: 'gridviewdragdrop',
                                 dragGroup: 'secondGridDDGroup',
                                 dropGroup: 'firstGridDDGroup'
                               },
                      listeners: {
                         drop: function(node, data, dropRec, dropPosition) {
                         var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';

                                                                           }
                                 }
                     }
                     
  
           
}



//second grid

function beforeInit(sender, config)
{
        config.listeners = {
            plugins: {
                ptype: 'gridviewdragdrop',
                dragGroup: 'firstGridDDGroup',
                dropGroup: 'secondGridDDGroup'
            },
            listeners: {
                drop: function(node, data, dropRec, dropPosition) {
                    var dropOn = dropRec ? ' ' + dropPosition + ' ' + dropRec.get('name') : ' on empty view';

                }
            }
            }
}

g2g.png

G2G.zip

Link to post
Share on other sites

Hi,

 

I was not able to run your test case,

 

Seems, should be so:

config.viewConfig = {
        plugins: {
            ptype: 'gridviewdragdrop',
...

Best regards.

Thank you , it works ! 

 

i'm searching now how to detect the drop event .

Link to post
Share on other sites

im' trying to detect the start drag event using :

unisession.AddJS('var yg = document.getElementById(MainForm.Grid1.id);');
unisession.AddJS('function dragStart(evt){ ajaxRequest(sender,"drag an item");}');
unisession.AddJS('yg.draggable = true;');
unisession.AddJS('yg.addEventListener("dragstart", dragStart, false); ');

it say yg is null :(

Link to post
Share on other sites
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...