Packageorg.openzet.controls
Classpublic class AdvancedSelectionDataGrid
InheritanceAdvancedSelectionDataGrid Inheritance AdvancedTreeDataGrid Inheritance mx.controls.AdvancedDataGrid
ImplementsICellSelectable
SubclassesAdvancedZetDataGrid

The AdvancedSelectionDataGrid control expands on the functionality of AdvancedTreeDataGrid except that it can allow drag selection of cells in a DataGrid.

The AdvancedSelectionDataGrid control provides the following features:

Public Properties
 PropertyDefined by
 InheriteddataProvider : Object
Overrides DataGrid's dataProvider property to show hierarchical data view on a AdvancedTreeDataGrid control.
AdvancedTreeDataGrid
  dragSelectionData : Object
[read-only] A method that returns drag-selected data as type of ArrayCollection.
AdvancedSelectionDataGrid
  enableDragSelection : Boolean
A Boolean property to allow drag selection of cells in a DataGrid.
AdvancedSelectionDataGrid
  moveArrow : Class
Arrow class to represent an icon when drag-moving data to other controls.
AdvancedSelectionDataGrid
  seriesType : String
Specifies the type of chart to show through context menu when user drag-selects cells of this DataGrid.
AdvancedSelectionDataGrid
 InheritedtreeColumnField : String
Function that returns treeColumnField.
AdvancedTreeDataGrid
 InheritedtreeDirection : String
A property to set TreeDataGrid's data direction, horizontal or vertical.
AdvancedTreeDataGrid
 InheritedtreeFields : Array
An array type of property to set dataFields that should be used as tree dataFields.
AdvancedTreeDataGrid
 InheritedtreeInfo : Dictionary
A dictionary that saves information on which node has which information, such as whether a specific node has children, whether is has been opened or not.
AdvancedTreeDataGrid
  xField : String
xField property to assign to a chart series shown through a context menu.
AdvancedSelectionDataGrid
Protected Properties
 PropertyDefined by
 Inheritedsource : Object
Property to store GroupingCollection instance's source data or ArrayCollection instance itself to reuse original data.
AdvancedTreeDataGrid
 InheritedtreeColumnInfo : Dictionary
A dictionary that saves information on how many items under a specific column have been opened.
AdvancedTreeDataGrid
Public Methods
 MethodDefined by
  
Constructor
AdvancedSelectionDataGrid
 Inherited
collapseTreeItem(item:Object, dataField:String = null):void
public function to collapse a child node's data either horizontally or vertically.
AdvancedTreeDataGrid
 Inherited
expandTreeItem(item:Object, dataField:String = null):void
public function to expand a child node's data either horizontally or vertically.
AdvancedTreeDataGrid
  
reset():void
A method that resets all the drag selection activity.
AdvancedSelectionDataGrid
Events
 EventSummaryDefined by
 Inherited Dispatched when tree's direction is changed.AdvancedTreeDataGrid
   Dispatched when a child node is closed.AdvancedSelectionDataGrid
   Dispatched when a child node is expanded.AdvancedSelectionDataGrid
 Inherited Dispatched when a child node is closed.AdvancedTreeDataGrid
 Inherited Dispatched when a child node is expanded.AdvancedTreeDataGrid
Styles
 StyleDescriptionDefined by
 Inherited Type: Class   Format: EmbeddedFile   CSS Inheritance: no
The icon that is displayed next to a closed branch node of the navigation tree.
AdvancedTreeDataGrid
  
dashLine
Type: Class   Format: EmbeddedFile   CSS Inheritance: no
DashLine Style
AdvancedSelectionDataGrid
  
dragLineThickness
Type: uint   Format: Color   CSS Inheritance: yes
Drag selection color The default value is 3.
AdvancedSelectionDataGrid
  
dragSelectionAlpha
Type: Number   Format: Color   CSS Inheritance: yes
Drag selection color The default value is 0.5.
AdvancedSelectionDataGrid
  
dragSelectionColor
Type: uint   Format: Color   CSS Inheritance: yes
Drag selection color The default value is 0x6378ed.
AdvancedSelectionDataGrid
 Inherited Type: Number   Format: Length   CSS Inheritance: no
The indentation for each node of the navigation tree, in pixels.
AdvancedTreeDataGrid
  
moveArrow
Type: Class   Format: EmbeddedFile   CSS Inheritance: no
Drag move arrow
AdvancedSelectionDataGrid
 Inherited Type: Class   Format: EmbeddedFile   CSS Inheritance: no
The icon that is displayed next to an open branch node of the navigation tree.
AdvancedTreeDataGrid
Property detail
dragSelectionDataproperty
dragSelectionData:Object  [read-only]

A method that returns drag-selected data as type of ArrayCollection.

Implementation
    public function get dragSelectionData():Object
enableDragSelectionproperty 
enableDragSelection:Boolean  [read-write]

A Boolean property to allow drag selection of cells in a DataGrid. If set to true, users can press on any itemRenderer instance shown on a DataGrid and start dragging cells scrolling up and down moving Mouse's position from left to right and vice versa.

Implementation
    public function get enableDragSelection():Boolean
    public function set enableDragSelection(value:Boolean):void
moveArrowproperty 
public var moveArrow:Class

Arrow class to represent an icon when drag-moving data to other controls.

This property can be used as the source for data binding.

seriesTypeproperty 
seriesType:String  [read-write]

Specifies the type of chart to show through context menu when user drag-selects cells of this DataGrid.

Implementation
    public function get seriesType():String
    public function set seriesType(value:String):void
xFieldproperty 
xField:String  [read-write]

xField property to assign to a chart series shown through a context menu. Default value is null.

Implementation
    public function get xField():String
    public function set xField(value:String):void
Constructor detail
AdvancedSelectionDataGrid()constructor
public function AdvancedSelectionDataGrid()

Constructor

Method detail
reset()method
public function reset():void

A method that resets all the drag selection activity.

Event detail
dragSelectionEndevent 
Event object type: org.openzet.events.SelectionDataGridEvent

Dispatched when a child node is closed.

dragSelectionStartevent  
Event object type: org.openzet.events.SelectionDataGridEvent

Dispatched when a child node is expanded.

Examples
SelectionDataGridExample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"  
    xmlns:zet="org.openzet.controls.*" layout="horizontal" creationComplete="initApp();" xmlns:dataGridClasses="org.openzet.controls.dataGridClasses.*">
    <mx:Script>
        <![CDATA[
            import mx.charts.series.LineSeries;
            import mx.events.AdvancedDataGridEvent;
            import mx.events.DataGridEvent;
            import mx.charts.series.ColumnSeries;
            import mx.charts.chartClasses.Series;
            import mx.core.UIComponent;
            import mx.managers.DragManager;
            import mx.events.DragEvent;
            import mx.collections.ArrayCollection;
            import flash.utils.*;
            import mx.charts.series.ColumnSeries;
            import org.openzet.controls.dataGridClasses.ICellSelectable;
            
            private function initApp():void {
                var arr:ArrayCollection = new ArrayCollection();
                var len:Number = 30 + Math.round(Math.random()*50);
                for (var i:int=0; i<len;i++) {
                    arr.addItem({});
                    arr[i].A= Math.random()*1000;
                    arr[i].B= Math.random()*1000;
                    arr[i].C= Math.random()*1000;
                    arr[i].D= Math.random()*1000;
                }
                dg.dataProvider = arr;
                dg2.dataProvider = arr;
                
            }
            private function dragEnterHandler(event:DragEvent):void {
                DragManager.acceptDragDrop(event.currentTarget as UIComponent);
                
            }
            private function dropHandler(event:DragEvent):void {
                var arr:ArrayCollection = ICellSelectable(event.dragInitiator).dragSelectionData as ArrayCollection;
                var fields:Array = cloneFields(arr);
                var series:Array=[];
                for (var i:int=0; i<fields.length;i++) {
                    var ser:ColumnSeries= new ColumnSeries();
                    ser.yField=fields[i];
                    ser.displayName = fields[i];
                    series.push(ser);
                } 
                chart.dataProvider=arr;
                chart.series=series; 
            }
            
            private function cloneFields(value:ArrayCollection):Array {
                var item:Object;
                var fields:Array;
                if (value && value.length >0) {
                    item = value[0];
                    fields = [];
                    for (var prop:String in item) {
                        fields.push(prop);
                    }
                }
                return fields;
            }
        ]]>
    </mx:Script>
    <mx:Panel width="100%" height="100%">
        <zet:AdvancedZetDataGrid rowHeight="30" enableDragSelection="true" seriesType="LineSeries"  id="dg" width="100%" height="100%">
            <zet:columns>
                <mx:AdvancedDataGridColumn dataField="A" textAlign="right" />
                <mx:AdvancedDataGridColumn dataField="B" textAlign="right" />
                <mx:AdvancedDataGridColumn dataField="C" textAlign="right" />
                <mx:AdvancedDataGridColumn dataField="D" textAlign="right" />
            </zet:columns>
        </zet:AdvancedZetDataGrid>
        <zet:ZetDataGrid  seriesType="BarSeries" enableDragSelection="true"   id="dg2" width="100%" height="100%">
            <zet:columns>
                <dataGridClasses:ZetDataGridColumn enableMerge="true" dataField="A" textAlign="right" />
                <dataGridClasses:ZetDataGridColumn enableMerge="true" dataField="B" textAlign="right" />
                <dataGridClasses:ZetDataGridColumn enableMerge="true" dataField="C" textAlign="right" />
                <dataGridClasses:ZetDataGridColumn enableMerge="true" dataField="D" textAlign="right" />
            </zet:columns>
        </zet:ZetDataGrid>
    </mx:Panel>
        <mx:ColumnChart id="chart" dragEnter="dragEnterHandler(event);" dragDrop="dropHandler(event);" width="100%" height="100%">
        </mx:ColumnChart>
</mx:Application>