Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3974508
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:34:33+00:00 2026-05-20T04:34:33+00:00

So this is driving me crazy. I’ve got an advanced data grid with a

  • 0

So this is driving me crazy. I’ve got an advanced data grid with a dataprovider that’s an array collection w/ hierarchical data. Each object (including the children) has an id field. I’m trying to drag and drop data from within the ADG. When this happens, I need to grab the id off the drop target and change the dragged object’s parentid field. Here’s what I’ve got:

public function topAccountsGrid_dragDropHandler(event:DragEvent):void{  
    //In this function, you need to make the move, update the field in salesforce, and refresh the salesforce data...
    if(checkActivateAccountManageMode.selected == true) {
        var dragObj:Array = event.dragSource.dataForFormat("treeDataGridItems") as Array;
        var newParentId:String = event.currentTarget['Id'];
        dragObj[0].ParentId = newParentId;
    } else {
        return;
    }
    app.wrapper.save(dragObj[0], 
        new mx.rpc.Responder(
            function():void {
            refreshData();
        },
        function():void{_status = "apex error!";}
        )
    );
}

I can access the data I’m draggin (hence changing parentId) but not the currentTarget. I think the hierarchical data is part of the problem, but I can’t find much in the documentation? Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:34:34+00:00Added an answer on May 20, 2026 at 4:34 am

    event.currentTarget is not a node, it’s the ADG itself. However, it’s quite easy to get the information you want, since the ADG stores that data internally (as mx_internal).

    I’m using the following code snippets (tested with Flex SDK 4.1) in a dragOver handler, but I guess it will work in a dragDrop handler too.

    protected function myGrid_dragDropHandler(event:DragEvent):void
    {
        // Get the dragged items. This could either be an Array, a Vector or NULL.
        var draggedItems:Object = getDraggedItems(event.dragSource);
    
        if (!draggedItems)
            return;
    
        // That's our ADG where the event handler is registered.
        var dropTarget:AdvancedDataGrid = AdvancedDataGrid(event.currentTarget);
    
        // Get the internal information about the dropTarget from the ADG.
        var dropData:Object = mx_internal::dropTarget._dropData;
    
        // In case the dataProvider is hierarchical, get the internal hierarchicalData aka rootModel.
        var hierarchicalData:IHierarchicalData = dropTarget.mx_internal::_rootModel;
        var targetParent:Object = null;
    
        // If it's a hierarchical data structure and the dropData could be retrieved
        // then get the parent node to which the draggedItems are going to be added.
        if (hierarchicalData && dropData)
            targetParent = dropData.parent;
    
        for each (var draggedItem:Object in draggedItems)
        {
            // do something with the draggedItem
        }
    }
    
    protected function getDraggedItems(dragSource:DragSource):Object
    {
        if (dragSource.hasFormat("treeDataGridItems"))
            return dragSource.dataForFormat("treeDataGridItems") as Array;
    
        if (dragSource.hasFormat("items"))
            return dragSource.dataForFormat("items") as Array;
    
        if (dragSource.hasFormat("itemsByIndex"))
            return dragSource.dataForFormat("itemsByIndex") as Vector.<Object>;
    
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me crazy. Is there someone out there that can help? Traceback
This is driving me crazy. Just testing a site on IE9 and discovered that
This is driving me crazy. I have this one php file on a test
This is driving me crazy. I'm not going to take it anymore. I'm going
I'm using .Net 2.0 and this is driving me crazy but there's probably some
This has been driving me crazy for a few days. Why doesn't the following
This is driving me crazy. I have the following string in a ASP.NET 2.0
This is driving me crazy and has resulted in lost work (not much, at
This is driving me crazy. I run into this every now and then on
This is driving me crazy. Ever since I installed ReSharper 4, F12 no longer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.