0 Replies Latest reply on Dec 18, 2008 1:38 PM by

    Advanced datagrid - cant expand empty node

      Hi,

      I have an advanced datagrid with drag and drop enabled. It is grouped using an ArrayCollection. I can drag leaf nodes and drop them into different folders within the list. Problem is that if a folder is empty then i can not drop any leaf nodes into it. it has no expand/hide icon. I have isBranch=true set on it. Here is how i create the collection:

      private var fs2:ArrayCollection =
      new ArrayCollection(
      [
      {
      name:"core", Summary:"true", children: new ArrayCollection(
      [
      {name: "router1", ipaddress:"10.100.50.1", description:"Joe woz ere"},
      {name: "router2", ipaddress:"10.100.50.2", description:"I woz ere"}
      ])
      },
      {name:"edge", Summary:"true", children: new ArrayCollection([
      {name: "router1", ipaddress:"10.100.50.1", description:"Joe woz ere"},
      {name: "router2", ipaddress:"10.100.50.2", description:"I woz ere"}
      ])
      },
      {name:"empty", isBranch:"true", children: new ArrayCollection([])
      }
      ]);

      And here is the datagrid:

      <mx:AdvancedDataGrid id="deviceGroups" dataProvider="{new HierarchicalData(fs2)}"
      height="100%" width="100%" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true">
      <mx:columns>
      <mx:AdvancedDataGridColumn headerText="Name" dataField="name"/>
      <mx:AdvancedDataGridColumn headerText="IP Address" dataField="ipaddress"/>
      <mx:AdvancedDataGridColumn headerText="Description" dataField="description"/>
      </mx:columns>
      </mx:AdvancedDataGrid>

      You can see in the ArrayCollection i hace a folder named empty with its children set to an empty ArrayCollection.
      I need to be able to drop items from the other 2 folders into this folder.
      Has anyone seen a way to do this before.
      Thanks,
      Joe.