Monday, April 27, 2009

AdvancedDataGrid control

The AdvancedDataGrid control expands on the functionality of the standard DataGrid control to add data visualization capabilities to your Adobe® Flex™ application.

The following table describes the main data visualization capabilities of the AdvancedDataGrid control:

Capability

Description

Sorting by multiple columns

Sort by multiple columns when you click in the column header. For more information, see Sorting by multiple columns.

Styling rows and columns

Use the styleFunction property to specify a function to apply styles to rows and columns of the control. For more information, see Styling rows and columns.

Displaying hierarchical and grouped data

Use an expandable navigation tree in a column to control the visible rows of the control. For more information, see Hierarchical and grouped data display.

Creating column groups

Collect multiple columns under a single column heading. For more information, see Creating column groups.

Using item renderers

Span multiple columns with an item renderer and use multiple item renderers in the same column. For more information, see Using item renderers with the AdvancedDataGrid control.



To disable sorting for an entire AdvancedDataGrid control, set the AdvancedDataGrid.sortableColumns property to false. To disable sorting for an individual column, set the AdvancedDataGridColumn.sortable property to false.

The way that you sort multiple columns is based on the setting of the sortExpertMode property. By default, the sortExpertMode property is set to false. This setting means that you click in the header area of a column to sort the rows of the AdvancedDataGrid control by that column. Then you click in the multiple column sort area of the header to sort by additional columns. To use the Control key to select every column after the first column to perform sort, set the sortExpertMode property to true.

DataGrid control

The DataGrid control is like a List except that it can show more than one column of data making it suited for showing objects with multiple properties.

The DataGrid control provides the following features:

  • Columns of different widths or identical fixed widths
  • Columns that the user can resize at runtime
  • Columns that the user can reorder at runtime
  • Optional customizable column headers
  • Ability to use a custom item renderer for any column to display data other than text
  • Support for sorting the data by clicking on a column
The DataGrid control is intended for viewing data.

Difference between ButtonBar and ToggleButtonBar controls

The ButtonBar control defines group of buttons that do not retain a selected state. When you select a button in a ButtonBar control, the button changes its appearance to the selected state; when you release the button, it returns to the deselected state.

The ToggleButtonBar control defines a group buttons that maintain their state, either selected or deselected. Only one button in the ToggleButtonBar control can be in the selected state. That means when you select a button in a ToggleButtonBar control, the button stays in the selected state until you select a different button.

The ButtonBar and ToggleButtonBar controls define a horizontal or vertical row of related buttons with a common appearance. The controls define a single event, the itemClick event, that is dispatched when any button in the control is selected.

Create view states

The base view state of an application or component is the default view state. If you omit any view state specifications, you can consider your application to have a singe view state: the base state.

To add additional view states to the base view state, you use the
tag. Within the body of the tag, you can add one or more tags, one for each additional view state.

The UIComponent class defines the currentState property that you use to set the view state. When the application starts, the default value of the currentState property is ' '.

An application or component can set the initial view state to a non-base view state. To use a view state other than the base state as the initial view state, set the currentState property to the specific view.

ControlBar Layout Container

You use the ControlBar container with a Panel or TitleWindow container to hold components that can be shared by the other children in the Panel or TitleWindow container.

About forms

Flex supports form development by using the Form layout container and several child components of the Form container. The Form container lets you control the layout of a form, mark form fields as required or optional, handle error messages, and bind your form data to the Flex data model to perform data checking and validation. Also, you can apply style sheets to configure the appearance of your forms.