Jump to content

Drag on Drop Treeview


herculanojs

Recommended Posts

On 4/25/2023 at 1:17 AM, Sherzod said:

Sorry, not yet.

Hi I put this code in a UnitreeView, de drag an drop work fine, but, how could I know in delphi where de parent node they are droped ? I need to update de BD with new targed node parent.

 

function beforeInit(sender, config)
{
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop',
            ddGroup: 'tree2panel',
            dragText : 'Movendo....',
            enableDrag : true,
            enableDrop : true,
            appendOnly: false
             },
        listeners: {
            beforedrop: function(node, data, overModel, dropPos, opts) {
                
            },
            drop: function(node, data, overModel, dropPos, opts) {
       ajaxRequest(sender, 'dropped', ['data='+data.records[0].data,
       'id='+data.records[0].data.id,
       'opts='+opts,
       'text='+data.records[0].data.text]);
                              
         
            }

        }
    };
}
 

Link to comment
Share on other sites

Hi I put this code in a UnitreeView, de drag an drop work fine, but, how could I know in delphi where de parent node they are droped ? I need to update de BD with new targed node parent.

 

function beforeInit(sender, config)
{
    config.viewConfig = {
        plugins: {
            ptype: 'treeviewdragdrop',
            ddGroup: 'tree2panel',
            dragText : 'Movendo....',
            enableDrag : true,
            enableDrop : true,
            appendOnly: false
             },
        listeners: {
            beforedrop: function(node, data, overModel, dropPos, opts) {
                
            },
            drop: function(node, data, overModel, dropPos, opts) {
       ajaxRequest(sender, 'dropped', ['data='+data.records[0].data,
       'id='+data.records[0].data.id,
       'opts='+opts,
       'text='+data.records[0].data.text]);
                              
         
            }

        }
    };
}

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks 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...