flex custom itemRenderer doesn't use the styles specified - apache-flex

I have a custom item renderer which I use for my DataGrid. The DataGrid has specified selectionColor, rollOverColor and themeColor. The Problem is that the custom item renderer, does ignore those colors, and doesn't give any Feedback...
I tried to add the lines:
setStyle("selectionColor", 0xEDF1F7);
setStyle("rollOverColor", 0xE1F5DE);
setStyle("themeColor", 0x3569B0);
But with no effect...
Who can help on that?
Thanks,
Markus

Those styles won't apply to the component you are using for your itemRenderer (which you don't mention). They're styles of the DataGrid itself.
So let's say you're using a Canvas. Try setting the backgroundAlpha of the Canvas to 0.0 so that your DataGrid's selection and other colors will show through.

Related

Change BorderColor of clicked item (itemrenderer) in List

Hello I want to set the BorderColor of certain Item Renderers (textInput) of a List. By default all have a common border color, but I want for example when clicking in an item to have a red border.
I tried this on a click event in my itemRenderer,
mytextInput.setStyle("color", 0xDDDDDD);
But it does not seem to work.
Any help.
Thx
As far as you're extending Spark TextInput control all the problems of that kind should be solved using skins. Create custom skin with the border you like.

Skinning Spark List Component

How to skin spark List component so that every adjacent itemRenderer has different color (something like mx DataGrid)?
You can do this by creating a custom renderer derived from ItemRenderer and overriding the itemIndex setter. In your overridden method, set the background color based on whether the item index is odd or even. The Adobe docs have an example of this which you can find in this section:
http://help.adobe.com/en_US/flex/using/WS03d33b8076db57b9-23c04461124bbeca597-8000.html#WS03d33b8076db57b9-43c4a246124bc002543-8000
Hope that helps.

how we add row /Remove row effect in datagrid

how we add effect in datagrid when we add or remove any row.
Thanks
Atul yadav
This is not supported as of Flex 4.6.
On the other hand, the effect is supported on MX List and MX TileList controls, if you can use them instead of DataGrid. In these controls, you can specify an effect with 'itemsChangeEffect', for example the DefaultListEffect that fades and collapses a row it when it is deleted.
Use properties 'addedEffect' and 'removedEffect' for DataGrid.
Define effect then use it. Smth like this:
<mx:EffectName id='effectId' here effect properties/>
<mx:DataGrid addedEffect='effectId'/>

Flex - How to find Datagrid Cell Object

I have datagrid in my page and I want to change particular cell background color. I don't want to use itemrenderer. Is there any alternate ?
Here is an example of changing the selection color: Flex Examples
If you want to do more than that, I'm afraid you will have to use an itemRenderer.
You could subclass DataGrid and override the protected drawRowBackground() method or possibly drawColumnBackground(). These are intended to draw the background for an entire row or column but you may be able to get it to draw a special color only for the cell(s) you want.

Flex combobox custom icon

Trying to set the up and down state icons of a Flex Combobox to images. I see the property for changing the color of the icon, but no property to skin it. How can I do this?
The "properties" are actually styles on ComboBase: upSkin, downSkin, overSkin, disabledSkin.
The default is ComboBoxArrowSkin--take a look at the source code to get more details about overriding or customizing it.

Resources