Jump to content

Drag on Drop Treeview


herculanojs

Recommended Posts

Hi,

 

Yes it is possible, but you should think about synchronization with the server

function beforeInit(sender, config) {
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop'
        }
    };
}

Best regards,

Link to comment
Share on other sites

Hi,

 

Yes it is possible, but you should think about synchronization with the server

function beforeInit(sender, config) {
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop'
        }
    };
}

Best regards,

How could you make it so that in ondrag drop it could be added as no child in another?

Link to comment
Share on other sites

How can I capture the Dragdrop event?

 

function beforeInit(sender, config) {
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop'
        }
    };
}

 

 

O código acima apenas permite o drag de uma posição superior/inferior. Necessito mover nós entre níveis. Colocar um nó dentre de outro. 

Como posso capturar o nó que esta sendo movido, e sobre qual nó esta sendo sobreposto.
 
The above code only allows drag from an upper / lower position. I need to move knots between levels. Put one knot from another.
How can I capture the node being moved, and which node is being overlapped.
 
in vlc
 
procedure TfrmGrupo.trvMenuDragDrop(Sender, Source: TObject;
  X, Y: Integer);
var
  AnItem: TTreeNode;
   AttachMode: TNodeAttachMode;
   HT: THitTests;
begin
     if trvMenu.Selected = nil then Exit;
        HT := trvMenu.GetHitTestInfoAt(X, Y) ;
     AnItem := trvMenu.GetNodeAt(X, Y) ;
     if (HT - [htOnItem, htOnIcon, htNowhere, htOnIndent]<> HT) then
     begin
          if (htOnItem in HT) or (htOnIcon in HT) then
             AttachMode := naAddChild
          else
          if htNowhere in HT then
             AttachMode := naAdd
          else
          if htOnIndent in HT then
             AttachMode := naInsert;
 
          trvMenu.Selected.MoveTo(AnItem, AttachMode);
 
   end;
end;
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 1 month later...

Hi,

 

Yes it is possible, but you should think about synchronization with the server

function beforeInit(sender, config) {
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop'
        }
    };
}

Best regards,

I need to drag dragdrop between us, putting one inside of others, with all his children if they have. How can I do this? I did not find anything in the forum

Link to comment
Share on other sites

  • 3 weeks later...
  • 11 months later...
  • 3 years later...
  • 1 month later...
On 11/26/2022 at 8:26 PM, Tokay said:

Up

 

1 hour ago, VolkovVitalD said:

I also really need such functionality :)

Hello, 

The main logic of these things is done on the server side and stored in the database. Do you have server side logic using DB?

Link to comment
Share on other sites

18 hours ago, Sherzod said:

The main logic of these things is done on the server side and stored in the database. Do you have server side logic using DB?

There is no problem to make the base side: just change one, node root, id. But graphical interface of drag-drop is ugly as in UniDbTreeView as in UniTreeView. And it's important for us.

Link to comment
Share on other sites

On 1/12/2023 at 9:34 PM, Sherzod said:

 

Hello, 

The main logic of these things is done on the server side and stored in the database. Do you have server side logic using DB?

I use UniTreeView, and the tree is stored in the database. I understand that I will need to implement the logic of moving nodes in storage on my own.

Link to comment
Share on other sites

  • 2 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...