[Flex] One labelfunction for multiple datagridcolumns

On March 27, 2007, Flash / Flex - 2 Comments

The labelfunction of a listbased component is nice, but a bit limited.
For instance, you have to specify the (data)fieldname inside the function, which makes it impossible to use it for other columns. Wouldn’t it be nice if you could write one labelfunction for all your columns? I thought it would.

In order to accomplish this, I needed to have the columndata inside the labelFunction. At first, I was thinking of extending the labelFunction, but that wouldn’t help me much, because Flex was still sending only the original data and not the columndata. So I went deeper in the component, searching for the function responsible for calling the labelFunction.

more…

[Flex] Custom treeicons without embedding them

On , Flash / Flex - 11 Comments

Sometime ago a wanted a tree with all different kinds of icons, depending on the type of the branch. Flex has some support for this, but only for embedded images. The problem was that I couldn’t use embedded images because the images are loaded dynamically from a database. So I had to find a way to fool flex, and the solution is quite simple. more…

[Flex / CSS] DateField / DateChoosers….

On March 7, 2007, Flash / Flex - 1 Comment

I’m currently working on skinning an Flex Application, and I ran in some strange CSS behavior. When you skin a datechooser component and set some styles with CSS like this:

DateChooser{
	rollOverIndicatorSkin: Embed(source="/assets/skin/flex_skins2.swf", symbol="DateChooser_rollOverIndicatorSkin");
	selectionIndicatorSkin: Embed(source="/assets/skin/flex_skins2.swf", symbol="DateChooser_selectionIndicatorSkin");
	headerColors: #333333, #000000;
   	backgroundColor: #474747;
   	color: #a7a7a7;
   	headerStyleName: "mydateChooserHeaderStyle";
}
 
.mydateChooserHeaderStyle {
   color: #a7a7a7;
}

and insert a datefield, not all styles are applied to the build-in datechooser of the datefield (for instance, the background-color, it just stays white).

The solution to this problem is to use the date-chooser-style-name property of the datefield. You then can specify a classname for the datechooser. The problem with this solution is that you get two classes, specifying the same component.

But then I thought wait… It’s CSS right? So I can specify styles for multiple classes or containers, like this:

DateChooser, .date-chooser{
	/* code here */
}
 
DateField{
	date-chooser-style-name: "date-chooser";
}