| Package | org.openzet.controls |
| Class | public class SelectionDataGrid |
| Inheritance | SelectionDataGrid TreeDataGrid mx.controls.DataGrid |
| Implements | ICellSelectable |
| Subclasses | ZetDataGrid |
SelectionDataGrid control is like a TreeDataGrid except that it can
allow drag selection of cells in a DataGrid.
The SelectionDataGrid control provides the following features:
| Property | Defined by | ||
|---|---|---|---|
![]() | dataProvider : Object
Overrides DataGrid's dataProvider property to show hierarchical data view
on a TreeDataGrid control.
| TreeDataGrid | |
| dragSelectionData : Object [read-only]
A property that returns drag-selected data as type of ArrayCollection.
| SelectionDataGrid | ||
| enableDragSelection : Boolean
A Boolean property to allow drag selection of cells in a DataGrid.
| SelectionDataGrid | ||
| moveArrow : Class
Arrow class to represent an icon when drag-moving data to other controls.
| SelectionDataGrid | ||
| seriesType : String
Specifies the type of chart to show through context menu when user drag-selects
cells of this DataGrid.
| SelectionDataGrid | ||
![]() | treeColumnField : String
Function that returns treeColumnField.
| TreeDataGrid | |
![]() | treeDirection : String
A property to set TreeDataGrid's data direction, horizontal or vertical.
| TreeDataGrid | |
![]() | treeFields : Array
An array type of property to set dataFields that should be used as tree dataFields.
| TreeDataGrid | |
![]() | treeInfo : 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.
| TreeDataGrid | |
| xField : String
xField property to assign to a chart series shown through a context menu.
| SelectionDataGrid | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor
| SelectionDataGrid | ||
![]() |
collapseTreeItem(item:Object, dataField:String = null):void
public function to collapse a child node's data either horizontally or vertically.
| TreeDataGrid | |
![]() |
expandTreeItem(item:Object, dataField:String = null):void
public function to expand a child node's data either horizontally or vertically.
| TreeDataGrid | |
|
reset():void
A method that resets all the drag selection activity.
| SelectionDataGrid | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | Dispatched when tree's direction is changed. | TreeDataGrid | ||
| Dispatched when a child node is closed. | SelectionDataGrid | |||
| Dispatched when a child node is expanded. | SelectionDataGrid | |||
![]() | Dispatched when a child node is closed. | TreeDataGrid | ||
![]() | Dispatched when a child node is expanded. | TreeDataGrid | ||
| Style | Description | Defined by | ||
|---|---|---|---|---|
![]() | Type: Class Format: EmbeddedFile CSS Inheritance: no The icon that is displayed next to a closed branch node of the navigation tree. | TreeDataGrid | ||
|
dashLine
| Type: Class Format: EmbeddedFile CSS Inheritance: no DashLine Style | SelectionDataGrid | ||
|
dragLineThickness
| Type: uint Format: Color CSS Inheritance: yes Drag selection color The default value is 3. | SelectionDataGrid | ||
|
dragSelectionAlpha
| Type: Number Format: Color CSS Inheritance: yes Drag selection color The default value is 0.5. | SelectionDataGrid | ||
|
dragSelectionColor
| Type: uint Format: Color CSS Inheritance: yes Drag selection color The default value is 0x6378ed. | SelectionDataGrid | ||
![]() | Type: Number Format: Length CSS Inheritance: no The indentation for each node of the navigation tree, in pixels. | TreeDataGrid | ||
|
moveArrow
| Type: Class Format: EmbeddedFile CSS Inheritance: no Drag move arrow | SelectionDataGrid | ||
![]() | Type: Class Format: EmbeddedFile CSS Inheritance: no The icon that is displayed next to an open branch node of the navigation tree. | TreeDataGrid | ||
| dragSelectionData | property |
dragSelectionData:Object [read-only]A property that returns drag-selected data as type of ArrayCollection.
Implementation public function get dragSelectionData():Object
| enableDragSelection | property |
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
| moveArrow | property |
public var moveArrow:ClassArrow class to represent an icon when drag-moving data to other controls.
This property can be used as the source for data binding.
| seriesType | property |
seriesType:String [read-write]Specifies the type of chart to show through context menu when user drag-selects cells of this DataGrid. Default value is ColumnSeries.
Implementation public function get seriesType():String
public function set seriesType(value:String):void
| xField | property |
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
| SelectionDataGrid | () | constructor |
public function SelectionDataGrid()Constructor
| reset | () | method |
public function reset():voidA method that resets all the drag selection activity.
| dragSelectionEnd | event |
org.openzet.events.SelectionDataGridEvent
Dispatched when a child node is closed.
| dragSelectionStart | event |
org.openzet.events.SelectionDataGridEvent
Dispatched when a child node is expanded.
<?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>