Drag and Drop from DataGrid or AdvancedDataGrid to Tree

December 16, 2009

One of the coolest things in Flex is the ability to create Drag and Drop operations very easily. For List base controls like the List and DataGrid / AdvancedDataGrid, it works out of the box, just set the dragEnabled property of the source and the dropEnabled property of the other and it’s already working. Dragging and Dropping to a Tree however, does not work by simply setting the dropEnabled property. The following example shows you how you can drag items from a DataGrid / AdvancedDataGrid to a Tree.

Read more

Style AdvancedDataGrid depending on data example

December 15, 2009

Besides displaying Trees, SummaryRows and stuff like that, the AdvancedDataGrid has another nice feature the standard DataGrid doesn’t have: a styleFunction! Using that we can style the label as we like for each column in each row. Take a look at the following example to find out how its done.

Read more

ArrayCollection Filter Example

November 17, 2009

This example is all about filtering an ArrayCollection in a DataGrid. We will filter the ArrayCollection using the input from the TextInput field, the value entered as the datagrid values are translated to lower case.

Read more

Viewstack Repeater Example

November 16, 2009

The following example shows you how to use a repeater inside a viewstack.  Our example about viewstack effects is very popular, and I recently found out how to use the repeater inside a viewstack, I decided to write an example about this subject.

Read more

Looping over an ArrayCollection with Cursor Example

November 10, 2009

There are different ways to loop over an ArrayCollection, the two approaches that are used to most are (I think) the folling two:

1
2
3
4
5
// Assuming that I have a declared variable "ac" of type ArrayCollection which is not null
for( var i:int=0; i<ac .length; i++ )
{
    //Do something here
}

and

1
2
3
4
for each( var obj:Object in ac )
{
    //Do something here
}

Works fine of course, but if you are, for example, searching for something in the collection you still have to get the current item from the collection etc. etc. So is there a better way? Yes there is.
Read more