Jump to content

Drag & Drop rows between 2 UniDbGrids Test Case


dunham

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 comment
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 comment
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 comment
Share on other sites

  • 5 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...