Grey Line

I picked up a growing concern in flexcoders forum messages related to the need of itemRenderers use to do simple things – like changing the color of the field in DataGrid depending on the column value or things like that. Using the terminology from the forum, it is like “hunting a rabbit with elephant gun”.

So, let us switch the target. You want that customization functionality inline, with as little glue as possible. If you want common functionality in most of your controls, go to the lower level. DataGrid control has itemRenderer property to specify the factory used by all the controls on the DataGrid.

Add that to the previous post (http://flexblog.faratasystems.com/?p=91) – and you can have declarative way to add any behaviour to the datagrid columns. Here is my post from FlexCoders back in July  showing performance  of run-time styles implementation within DataGrid (case 3). Please note using formula checking the salary range for run-time colors styles:

case 1 : basic  grid – no formatting or styling

case 2:  basic grid with typical formatting – no styling
case 3:  typical usage of formatting and styling – IMPLEMENTED VIA RUN-TIME CSS AND COMPUTED EXPRESSIONS – very straightforward code in KISS paradigm. Use right mouse button to see the code for examples.

Personally, I hate big guns, but with this one you can safely offload most of run-time styling  and customization to the BA staff while maintaining control of the implementation and performance.

And the clients get code that is smaller, simplier to read and maintain

Enjoy,

Anatole

 

 

 

Leave a Comment