Setting font style on hover for spark datagrid

I'm trying to skin a Spark datagrid. I have most things sorted by creating a custom skin, but one thing I can't find is how to set the colour of the row's font on hover. I can set the background colour fine, but how would I go about changing the font colour when a user hovers over the row?
Thanks

Hi
You don’t actually deal with the text that’s displayed in the a datagrid inside of the skin
Look at item renderers for the grid columns. You can style your text or whatever else you would like to display in the grid, in the renderer
Hope that helps a little
If you are still stuck just let me know and I’ll send you some code
Cheers
g
heres some code
NOTE: I am making this up as I sit here so I may be forgetting something. Don’t be surprised if this doesn’t work, but the basic idea is right I think
So in the spark datagrid when you set your column (if you use mxml) this will replace a glob renderer so you can have a different one for each column if you wish.
<s:GridColumn dataField="Status"
headerText="name"
width="37"                                                    
itemRenderer="fooRenderer"
/>
Or set a gloabel renderer in the grid def itself
<s:DataGrid itemRenderer=”fooRenderer” />
Then write a custom renderer: fooRenderer.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx"
                     clipAndEnableScrolling="true"
                     >
       <fx:Script>
              <![CDATA[
                     override public function discard(willBeRecycled:Boolean):void
                           labelData.text="";
                           super.discard(willBeRecycled);
                     override public function prepare(hasBeenRecycled:Boolean):void
                           if(data)
                                   // set the colour of the text label to black
                                  labelData.setStyle("color",0x000000)
                                  // put some logic here to dynamic style the label
                           //check for the 'format' function on the column  (THIS MAY BE WRONG)
                           if( column.labelFunction != null )
                                  labelData.text = column.labelFunction( data, column );
                           else
                                  labelData.text = data[column.dataField];
                     super.prepare(hasBeenRecycled);
              ]]>
       </fx:Script>
       <s:Label id="labelData" />
</s:GridItemRenderer

Similar Messages

  • Setting the font style and color for FileChooser labels

    Hi Friends,
    I have a certain standard Font style and color set for my application GUI. Now, I want to set the style and color for Swing components like FileChooser. Is it possible ?
    Also is it possible to localize JOptionPane ?
    Please advise.
    Best regards,
    Harilal.

    Does anybody knows how to do that?

  • I need the font style century gothic for a project im working on, but neither my final cut pro x nor my photoshop have this font style. Where do you get/buy new fonts?

    I need the font style century gothic for a project im working on, but neither my final cut pro x nor my photoshop have this font style. Where do you get/buy new fonts?

    Not on this list.
    Maybe it gets installed with something else? For example, I have MS Ofiice on the 10.7 system but not on the others.
    Russ

  • [svn:fx-trunk] 8652: Set ControlBar borderStyle to "none" for Spark skins.

    Revision: 8652
    Author:   [email protected]
    Date:     2009-07-16 17:16:28 -0700 (Thu, 16 Jul 2009)
    Log Message:
    Set ControlBar borderStyle to "none" for Spark skins.
    QE notes: -
    Doc notes: -
    Bugs: SDK-21399
    Reviewer: Jason
    Tests run: checkintests, QE cyclone
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21399
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/defaults.css

  • Setting font style and size

    I have created a form in Acrobat 9 Pro with multiple text fields for which I would like to make sure only a certain font style & size is used (e.g., Arial 10). I have set this in the properties of the text box, but when I test it by cutting and pasting from a Word document (which our applicants are likely to do), it keeps the original formatting and does not follow the settings I created. Is there a way to allow the cutting and pasting, but only into the settings I've made?
    Thanks for any help!

    Probably. Try doing the same with the field that doesn't have this setting
    turned on, and you'll know for sure...

  • Want to implent CheckBox for itemRenderer and headerItemRenderer for spark DataGrid.

    I am using mx:DataGrid in my application.
    The first column itemRenderer and headerItermRenderer is CheckBox.
    Now I want to move it to spark DataGrid. I could imprement itermRenderer easily by creating sub-claassing GridItemRenderer. But I am struck at implementing headerItermRenderer. I tried to implent it using GridItemRenderer sub-class as I did with itemRenderer. It is not working. The set data method is not getting called.
    Do anyone have code for implenting checkbox as itemRenderer and headerRendere in spark datagrid (and not mx datagrid)?
    Thanks,
    Prithvee Zankat.

    Hi,
    Item renderer can be implemented for spark and i think you will have to write custom header renderer. I am providing some useful links,please go through them :
    http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff3.html
    http://cookbooks.adobe.com/post_3_state_checkbox_for_header_renderer_in_datagrid-18900.htm l
    http://blogs.adobe.com/aharui/category/item-renderers
    http://boardreader.com/thread/Spark_Datagrid_custom_header_renderer_1zw07Xgoeo.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Create custom scrollbar for Spark Datagrid

    I had a custom scroll bar for a MX datagrid.  But recently I got the new Flash Builder 4.5 and it said to use the Spark Datagrid component instead.  So I changed everything to Spark, but now I can't find any info on customizing the scroll bar.  Is this possible?  Should I go back to mx?
    According to the documentation in Flash Builder:
    "The Spark DataGrid control provides the following features:
    - Custom skins to control all aspects of the appearance of the DataGrid control"
    So I'm hoping it's possible but I can't find any info either way.

    Thanks.  I'm not sure exactly how I did it, but I started with this document in Flash Builder Help:
    "Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4"
    I copied the code and changed "s|List" to "s|Datagrid", modified it accordingly for a vertical scroll bar, and I deleted references to "base color" so that it would compile.   Then, I copied in VScrollBarTrackSkin.mxml and VScrollBarThumbSkin.mxml from the Flash Builder directory: Adobe Flash Builder 4.5\sdks\4.5.1\samples\themes\zen\src\zen\skins.  And I removed the references to the swf files so that it would compile.  Then I embedded my own png images, e.g.: source.up="@Embed(source='/images/thumb.png')". And I got a scrollbar!
    Only problem is the example does not have up and down controls.  But I figured this out from looking at the zen skins (VScrollBarSkin / HScrollBarSkin) and copying in the code for the up and down buttons as well.  Now it's working pretty good.
    [I did not use any of the Flash Builder wizards/GUI to create the skins or files.  I just created the files individually (as in File - New - File).  Perhaps there's a better way to do it, but this worked for me.]
    I'm not sure why you suggested looking at "ScrollerSkin".  This didn't lead me anywhere, though perhaps I was not clear in my question.  But I greatly appreciate your answer, for saying that this is possible, otherwise I would have given up!

  • Setting font style -- Font Class

    Hi,
    How can I change the font style in the Font constructor? e.g.
    Font f = new Font("Dialog", Font.PLAIN, 10);is the default font style. I want the same object but with "Arial" style. I've tried
    Font f = new Font("Arial", Font.PLAIN, 10);but it doesen't work.
    Any idea?
    Thanks in advance

    from the JavaDocs:
    name - the font name. This can be a logical font name or a font face name. A logical name must be either: Dialog, DialogInput, Monospaced, Serif, or SansSerif.
    You want SansSerif
    Good Luck
    Lee

  • Upgrade to Flex 4, Halo theme, embedded font doesn't work for Spark Label

    I'm upgrading an application to Flex 4 from Flex 3.5 using the Halo theme.  If I include a Spark Label in my application the Spark Label does not render the text using the font I defined in my CSS.  My MX Labels render fine.  Here is an example application that replicates my issue.  So,
    Compile and run using Spark theme.  Both Labels render the text with the correct font.
    Compile and run using Halo theme.  Only MX Label renders the text with the correct font.
    Is it not possible to do what I want?
    Thanks
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      minWidth="250" minHeight="250">
         <fx:Style>
              @namespace mx "library://ns.adobe.com/flex/mx";
              @namespace s "library://ns.adobe.com/flex/spark";
              @font-face
                   fontFamily: Verdana;
                   fontWeight: normal;
                   fontStyle: normal;
                   src: url("./style/fonts/verdana.ttf");
                   embedAsCFF: false;
              @font-face
                   fontFamily: VerdanaCFF;
                   fontWeight: normal;
                   fontStyle: normal;
                   src: url("./style/fonts/verdana.ttf");
                   embedAsCFF: true;
              mx|Label
                   font-family: Verdana;
              s|Label
                   font-family: VerdanaCFF;
         </fx:Style>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:VGroup>
              <mx:Label text="My text" />
              <s:Label text="My text" />          
         </s:VGroup>
    </mx:Application>

    I think you might need to set the fontLookup:
            s|Label
                font-family: VerdanaCFF;
                fontLookup: "embeddedCFF";     

  • Error while creating a custom combobox for Spark DataGrid

    I am getting the following run time error:
    Error: Required skin part openButton cannot be found.
        atspark.components.supportClasses::SkinnableComponent/findSkinParts() [E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\componen ts\supportClasses\SkinnableComponent.as:671]
        atspark.components.supportClasses::SkinnableComponent/attachSkin()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\SkinnableComponent.as:646]
        atspark.components.supportClasses::SkinnableComponent/validateSkinCha nge()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\com ponents\supportClasses\SkinnableComponent.as:406]
        atspark.components.supportClasses::SkinnableComponent/commitPropertie s()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compo nents\supportClasses\SkinnableComponent.as:420]
         atspark.components.supportClasses::ListBase/commitProperties()[E:\dev  \hero_private_beta\frameworks\projects\spark\src\spark\components\supp  ortClasses\ListBase.as:808]
        atspark.components::List/commitProperties()[E:\dev\hero_private_beta\ frameworks\projects\spark\src\spark\components\List.as:954]
        atspark.components.supportClasses::DropDownListBase/commitProperties( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\DropDownListBase.as:504]
        atspark.components::ComboBox/commitProperties()[E:\dev\hero_private_b eta\frameworks\projects\spark\src\spark\components\ComboBox.as:644]
        atmx.core::UIComponent/validateProperties()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\core\UIComponent.as:8095]
         atmx.managers::LayoutManager/validateClient()[E:\dev\hero_private_bet  a\frameworks\projects\framework\src\mx\managers\LayoutManager.as:934]
        atmx.core::UIComponent/validateNow()[E:\dev\hero_private_beta\framewo rks\projects\framework\src\mx\core\UIComponent.as:7953]
        atspark.components.supportClasses::GridLayout/layoutItemRenderer()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\GridLayout.as:1808]
        atspark.components.supportClasses::GridLayout/createTypicalItemRender er()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\comp onents\supportClasses\GridLayout.as:460]
        atspark.components.supportClasses::GridLayout/updateTypicalCellSizes( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\GridLayout.as:514]
        atspark.components.supportClasses::GridLayout/layoutColumns()[E:\dev\ hero_private_beta\frameworks\projects\spark\src\spark\components\suppo rtClasses\GridLayout.as:570]
        atspark.components.supportClasses::GridLayout/measure()[E:\dev\hero_p rivate_beta\frameworks\projects\spark\src\spark\components\supportClas ses\GridLayout.as:230]
         atspark.components.supportClasses::GroupBase/measure()[E:\dev\hero_pr  ivate_beta\frameworks\projects\spark\src\spark\components\supportClass  es\GroupBase.as:1109]
        atmx.core::UIComponent/measureSizes()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8383]
        atmx.core::UIComponent/validateSize()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8307]
        atspark.components::Group/validateSize()[E:\dev\hero_private_beta\fra meworks\projects\spark\src\spark\components\Group.as:956]
        atmx.managers::LayoutManager/validateSize()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\managers\LayoutManager.as:659]
        atmx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_priv ate_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.a s:793]
        atmx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\h ero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutM anager.as:1157]
    Here is my combobox:
    package
        import mx.controls.listClasses.BaseListData;
        import mx.controls.listClasses.IDropInListItemRenderer;
        import spark.components.ComboBox;
        public class sparkComboRendererDataGrid extends ComboBox implements IDropInListItemRenderer
            public function sparkComboRendererDataGrid()
                super();
            public function get listData():BaseListData
                return null;
            public function set listData(value:BaseListData):void
            override public function set dataProvider(value:Object):void
                super.dataProvider = value;
                // This may get called before dataProvider is set, so make sure not null and has entries
                if (value!=null && value.length)
                    // Got it, set flag
                    bDataProviderSet = true;              
    and here is the implementation:
    var PersonnelPerson:ClassFactory = new ClassFactory(sparkComboRendererDataGrid);
    PersonnelPerson.properties = {labelField : "person", dataProvider :
    new XMLListCollection(dataList.consistcrew)};
    var col:GridColumn = GridColumn(personnel.columns.getItemAt(0));                   
    col.itemRenderer = PersonnelPerson;
    Please help.
    Thanks

    Actually, after adding the following code it started working:
    import spark.skins.spark.DropDownListSkin;
    override public function stylesInitialized():void
          super.stylesInitialized();
          this.setStyle("skinClass", DropDownListSkin);

  • How to change the header text fontFamily of spark DataGrid?

    I use an embed font (Nunito-Light.ttf),  and i can set the font of GridColumn to Nunito-Light in DataGrid , but it seems that it has no effect to the header of DataGrid.
    and then I create a  headerRenderer for spark DataGrid, and try to set the fontFamily of "labelDisplay" to Nunito-Light  , but It seems still no effect .
    If I set the fontFamily of "labelDisplay" to "Verdana" or "Arial" , it has effect , so strange! Is that a bug?
    Anybody  has the same problem? Please tell me how to solve it ,thank you very much!

    Hi,
    Please go through following link :
    http://forums.adobe.com/thread/870081#870081
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Line wrapping and font styles?

    Hi,
    If I have a piece of text which I would like to see line wrapped, and font styled, how should I do that?
    javax.swing.JTextArea has the capabilities to set line wrapping to on.
    javax.swing.JTextPane has the capabilities to set font styles like bold, italic and so on.
    But what if you have a piece of text you don't know the (possible) length of (so you would like to have line wrapping), AND to which you want to apply font styles to. JTextArea and JTextPane are siblings, not ancestors. So I can't use it. I have looked in the code to see if I could use pieces of code in my own program. But not luck.
    Do you have a suggestion for me?
    TIA,
    Abel

    camickr wrote:
    JTextPane wraps by default. I'm not sure what your problem is.I did not know that JTextPane did wrap. And I could not find it in the documentation.
    But thanks for the information!

  • How to set Font to the ToolTip in JComboBox

    Hi,
    I am having problem in setting font to the ToolTip for JComboBox.
    Help needed asap...
    TIA,
    CK

    From the Mail menu bar click Mail > Preferences then select the Fonts & Colors tab.
    You can reset fonts sizes from there.
    Another way to open Mail Preferences, with Mail running, press Command ,  (comma) on your keyboard.
    The Mavericks upgrade may have reset that data to factory settings.

  • Questions about Spark DataGrid (Header Font Styles, Header Gradient)

    Just starting out in 4.5 SDK, and just a tad confused on the Spark DataGrid.
    1) Trying to set the font style for just the header, but don't see those properties in the designer....as they appear to apply to every part of the DataGrid.
    2) Want to set a linear gradient for the header utilizing two specific colors, alphas and ratios.  Not sure where to set them now.
    I think that is it for now.  From what I have done with it so far, I love it....just obviously not as much user documentation as the MX DataGrid.
    Thanks in advance!
    Bill

    You can do per column header renderers by setting the headerRenderer property on the column. But if you want to swap out all the headers, the header renderer has to be specified in the skin. One neat trick you can do is subclass the DataGridSkin and replace the "headerRenderer" declaration. This also works with the other skin parts.
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DataGridSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:skins="spark.skins.spark.*">
        <fx:Declarations>
            <!-- See DataGridSkin for other possible parts -->    
            <fx:Component id="headerRenderer">
                <s:CustomGridHeaderRenderer />
            </fx:Component>
        </fx:Declarations>
    </skins:DataGridSkin>
    -Kevin

  • How to change header font style in Spark DataGrid?

    I'm looking since last week for a way how to change the font style of the header in a Spark DataGrid. It drive me nuts that I can't find a way to do this. Have anyone one an idea how to achieve it? Any help is appreciated.
    Thanks,
    - Artur

    Hi,
    Some styles won't work because some text styles got hardcoded into the DefaultGridHeaderRenderer's Label. You'll run into this issue not just with the DataGrid headers but also things like the Panel's title and other places where we have text. One way to get around this issue is to create your own custom headerRenderer based on the default one and then redefine the headerRenderer skin part in the skin.
    First, create a subclass of the DefaultGridHeaderRenderer and tweak the "labelDisplay" to your liking (or even just take out all the styles and style it on your own as you had earlier using your custom header renderer's name). Example below (I named it "CustomHeaderRenderer"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DefaultGridHeaderRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     xmlns:skins="spark.skins.spark.*"
                                     xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Remove fontweight="bold" and other styles as you wish
                 Must be a component and not a factory. -->
            <s:Label id="labelDisplay"
                     verticalCenter="1" left="0" right="0" top="0" bottom="0"
                     textAlign="start"
                     verticalAlign="middle"
                     maxDisplayedLines="1"
                     showTruncationTip="true" />
        </fx:Declarations>
    </skins:DefaultGridHeaderRenderer>
    Next, create a simple DataGrid skin by creating a subclass of the  spark.skins.spark.DataGridSkin in MXML and defining a new headerRenderer  component in the fx:Declarations section. Example below (I named it "CustomDataGridSkin"):
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DataGridSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:skins="spark.skins.spark.*"
                    xmlns:comps="comps.*">
        <fx:Declarations>
            <!-- Must be a factory with the right id for the skin part -->
            <fx:Component id="headerRenderer">
                <comps:CustomHeaderRenderer />
            </fx:Component>
        </fx:Declarations>
    </skins:DataGridSkin>
    Last, assign your new skin as the skinClass of your DataGrid (either in MXML or as a style):
    <s:DataGrid skinClass="comps.CustomDataGridSkin">
    I know it's not pretty, but it's the result of trading off between having completely custom skinning vs. having knobs to tweak every style. Hope this helps.
    -Kevin

Maybe you are looking for

  • Installing Leopard From An External Hard Drive

    Hi everyone, It's been a long journey trying to get my mac fixed after it started acting up and obviously since I am posting here it is not fixed yet. I need to re-install os x on an external drive and it is telling me that I have to erase everything

  • Finding out the deleted instance from a recurrent set of events

    Good Morning, We have a requirement to find out all the events which belong to a uid in a recurrent event. When the event is created the RRULE returned is: RRULE:FREQ=MONTHLY;BYMONTHDAY=16;COUNT=6;INTERVAL=1;WKST=SU I then change the date of one of t

  • Week wise report

    Hello all,   I  would like to create new report  for weekly wise details.But I do not know how to generate valid query for which report . The requirement like this, the user will dynamically give two dates like 'from date' and 'to date'   and every w

  • Dynamic reading headers external table

    Hi, I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this pr

  • Attempting to Manage User Profile service results in error messages

    Hello folks. I've been working on this issue for a bit now, and have searched a number of different ways.  Everything I find as a result says "do an iisreset" as the only solution - I've done multiple iisresets and rebooted the server at least twice.