Datagrid styling in Flashbuilder

Hey everyone,
I have some issues styling a Datagrid with Flashbuilder.
My problem is skinning the Datagrid. I wan't to have the Datagrid transparent, which I used to achieve by setting backgroundAlpha="0" and alternatingItemColors="{[]}" in Flexbuilder. This doesn't work when the compiler uses the Spark Theme. The thing is I don't want to use the Halo Theme on all my Components like Peter explains here: http://blog.flexexamples.com/2009/07/14/using-the-halo-theme-in-flex-4/ Is there a way of getting the Datagrid transparent without using the halo theme?
The second issue I have is regarding fonts in the Datagrid. I managed to embed system fonts like Arial or Verdana, but when it comes to the .ttf the designer wants me to use, no text is displayed. I found out, that the Datagrid uses bold fonts for default. I've set the font-weight to normal on the columns but they still stay empty.
Here's my css code:
@font-face
    src:                        url("assets/fonts/FuturaCom-Medium.ttf");
    fontWeight:                 normal;
    fontFamily:                 myFuturaMedium;
    advancedAntiAliasing:       true;
    cff:                        true;
    unicode-range:              U+0020-U+007E,  /* englishRange & basic latin */
                                U+00A0-U+00FF, /* basic latin with umlaut äöü*/
                                U+20AC-U+20AC;
.myDatagrid{
    fontFamily: myFuturaMedium;
    font-weight:normal;
    color: #FFFFFF;   
Thanks in advance. Help is highly appreciated!

Or the other approach (a custom skin) would be something like this:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo"
        backgroundColor="red">
    <s:layout>
        <s:VerticalLayout paddingLeft="20" paddingTop="20" />
    </s:layout>
    <mx:DataGrid id="dataGrid"
            alternatingItemColors="[]"
            borderSkin="skins.CustomBorderSkin">
        <mx:dataProvider>
            <s:ArrayList>
                <fx:Object c1="0.One" c2="0.Two" />
                <fx:Object c1="1.One" c2="1.Two" />
                <fx:Object c1="2.One" c2="2.Two" />
                <fx:Object c1="3.One" c2="3.Two" />
                <fx:Object c1="4.One" c2="4.Two" />
                <fx:Object c1="5.One" c2="5.Two" />
                <fx:Object c1="6.One" c2="6.Two" />
                <fx:Object c1="7.One" c2="7.Two" />
                <fx:Object c1="8.One" c2="8.Two" />
                <fx:Object c1="9.One" c2="9.Two" />
            </s:ArrayList>
        </mx:dataProvider>
    </mx:DataGrid>
</s:Application>
And the custom border skin, skins/CustomBorderSkin.mxml, is as follows:
<?xml version="1.0" encoding="utf-8"?>
<local:SparkSkinForHalo xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:local="mx.skins.spark.*" implements="mx.core.IRectangularBorder">
    <fx:Script>
        <![CDATA[
        import mx.core.EdgeMetrics;
        import mx.core.IUIComponent;
        import mx.graphics.RectangularDropShadow;
        /* Define the skin elements that should not be colorized. */
        static private const exclusions:Array = ["background"];
        override public function get colorizeExclusions():Array {return exclusions;}
        /* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
        static private const contentFill:Array = ["bgFill"];
        override public function get contentItems():Array {return contentFill};
        /* Define the border item. */
        static private const borderItem:Array = ["borderStroke"];
        override protected function get borderItems():Array {return borderItem;}
        override protected function get defaultBorderItemColor():uint {return 0x696969;}
        static private const metrics:EdgeMetrics = new EdgeMetrics(1, 1, 1, 1);
        private var dropShadow:RectangularDropShadow;
        public function get borderMetrics():EdgeMetrics
            return metrics;
        public function get backgroundImageBounds():Rectangle
            return null;
        public function set backgroundImageBounds(value:Rectangle):void
        public function get hasBackgroundImage():Boolean
            return false;
        public function layoutBackgroundImage():void
        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            graphics.clear();
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            if (parent && parent is IUIComponent && !IUIComponent(parent).enabled)
                alpha = 0.5;
            else
                alpha = 1;
            // Draw drop shadow, if needed
            if (getStyle("dropShadowEnabled") == false ||
                getStyle("dropShadowEnabled") == "false" ||
                width == 0 ||
                height == 0)
                return;
            // Create a RectangularDropShadow object, set its properties,
            // and draw the shadow
            if (!dropShadow)
                dropShadow = new RectangularDropShadow();
            dropShadow.distance = 5;
            dropShadow.angle = 90;
            dropShadow.color = 0;
            dropShadow.alpha = 0.8;
            dropShadow.blurX = 20;
            dropShadow.blurY = 20;
            dropShadow.drawShadow(graphics, x, y, width, height);
        private function getDropShadowAngle(distance:Number,
                                            direction:String):Number
            if (direction == "left")
                return distance >= 0 ? 135 : 225;
            else if (direction == "right")
                return distance >= 0 ? 45 : 315;
            else // direction == "center"
                return distance >= 0 ? 90 : 270;
        ]]>
    </fx:Script>
    <s:Group left="0" right="0" top="0" bottom="0">
        <!-- border -->
        <s:Rect left="0" right="0" top="0" bottom="0">
            <s:stroke>           
                <s:SolidColorStroke id="borderStroke" />
            </s:stroke>
        </s:Rect>
        <!-- fill -->
        <s:Rect id="background" left="1" right="1" top="1" bottom="1" alpha="0">
            <s:fill>
                <s:SolidColor id="bgFill" color="0xFFFFFF" />
            </s:fill>
        </s:Rect>
    </s:Group>
</local:SparkSkinForHalo>
(The border skin was taken from %FLEX SDK%\frameworks\projects\sparkskins\src\mx\skins\spark\BorderSkin.mxml and I basically only added that alpha="0" bit on the background Rect fill.
This is one of the areas we are still trying to improve in Spark (backgroundImage, backgroundAlpha). If you have any list of styles that worked in Halo but aren't working any more in the default Halo control/container Spark skins, let us know.
Peter

Similar Messages

  • DataGrid Styling

    Hi All,
    I know that I can modify the skins for the Flash DataGrid Component inside an FLA and then export as a SWC to use if in my projects but I need to be able to modify the style of the component at runtime. Can anyone point me in the right direction or let me know if it is even possible.
    Any help is appreciated,

    http://kirill-poletaev.blogspot.com/2011/01/as3-datagrid-component-part-1.html

  • Spark Datagrid:  Styling the Header?

    Hi,
    Question for all the Spark and Datagrid gurus out there:
    How can I change the text style of the spark datagrid header?  For example, I want to make it blue with underlines.  More importantly I need to change the color on rollover and/or selection. 
    Second, how can I change the sort indicator/icon?  I'd like to substitute the up/down triangle with a graphic image or other mxml object. 
    I've searched the net high and low, but haven't yet found answers to the above questions.  Is there documentation for such things, or is a bunch of custom code required? 
    Within the DefaultGridHeaderRender (which I've duplicated), I did find the "labelDisplayGroup" and the "sortIndicatorGroup".  But how can these be customized?
    Thank you very much for any advice or help.  Regards,
    dana.

    Thank you Kevin for the reply. 
    Ideally we'd like to be able to clearly indicate to the user which column is selected.  With the default skin, the background color for the header renderer is used to indicate currently selected column.  However in the current design I'm working with, the background needs to be transparent.  So the goal is to indicated which header is selected by changing the header text color.  My hope was that whatever controls when the sort indicator and the background color change was also easily accessible.  But I can't find a way to leverage the existing controls to know when a column is selected.
    It sounds like instead I should write and append my own column selection control mechanism and/or events, which I can then use to change the text color. 
    In the future it might be nice to have a "selected" state for header renderers, like the rest of the datagrid items, to make it easily to program for and separate out the 'view' a bit more.  (Unless of course this already exists, and I'm just missing it.)
    Thanks for your replies,
    dana.

  • Datagrid styling. All even rows blue - odd rows white

    Hi.
    I have seen a lot of tables where the second row is white and the first is blue. This makes it easier to read the data for a particular students results.
    How could that be done - would you have to code it in ie: colour the even rows by targeting the even numbers or is there a built in way.
    Cheers

    Information:
    http://blogs.adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html
    http://blogs.adobe.com/pdehaan/2007/06/alternating_background_colors.html
    Source Files:
    http://blogs.adobe.com/pdehaan/code/section13.example1.zip
    http://blogs.adobe.com/pdehaan/code/section12.example1.zip

  • Problems with embedded font with medium or heavy weight

    Hey guys,
    I'm switching a current Project from Flashbuilder Beta2 to the Flashbuilder final release.
    I have a big problem concerning embedded fonts. The fonts I have to use are Futura Com Medium & Futura Com Heavy.
    Here's some of my code:
    @font-face
         src:                        url("assets/fonts/FuturaCom-Medium.ttf");
         font-weight:               normal;
         fontFamily:                 myFuturaMedium;
         advancedAntiAliasing:       true;
         embedAsCff:                 false;
    .myDatagrid{
         fontFamily: myFuturaMedium;
         color: #ff0000;   
    this worked well in beta2, but I'm not able to get the embedded Font working in the datagrid with the Flashbuilder final release.
    Any help on using embedded fonts in a mx|Datagrid is highly aprechiated.
    Cheers

    Hey guys,
    I'm switching a current Project from Flashbuilder Beta2 to the Flashbuilder final release.
    I have a big problem concerning embedded fonts. The fonts I have to use are Futura Com Medium & Futura Com Heavy.
    Here's some of my code:
    @font-face
         src:                        url("assets/fonts/FuturaCom-Medium.ttf");
         font-weight:               normal;
         fontFamily:                 myFuturaMedium;
         advancedAntiAliasing:       true;
         embedAsCff:                 false;
    .myDatagrid{
         fontFamily: myFuturaMedium;
         color: #ff0000;   
    this worked well in beta2, but I'm not able to get the embedded Font working in the datagrid with the Flashbuilder final release.
    Any help on using embedded fonts in a mx|Datagrid is highly aprechiated.
    Cheers

  • Flashbuilder 4.5 datagrid Generate Details Form not working

    flashbuilder 4.5 in datagrid when you right click the Generate Details Form
    is not there. Where is it?

    I see what you're saying. Right-clicking on an mx.controls.DataGrid in design view has a Generate Details Form option. Right-clicking on a spark.components.DataGrid in design view does not have this option.
    Let me ask around and get someone to reply with more information.
    Regards,
    Randy Nielsen
    Senior Content and Community Manager
    Adobe Systems Incorporated

  • Need some help styling datagrid...

    Hi,
    I have added a datagrid to my flex application and I need to give it a specific style but I can't get it to work.
    I need to remove the rollover color of the datagrid column headers. I've trawled through the flex forumns and website but so far I've been unable to find anything to help. Also, I want to give the datagrid an inset border, so that it looks sunken into the application background. I've tried setting the border style to inset but it doesn't look as though it has had any effect.
    Finally, I want to make the corners of the datagrid and datagrid columns rounded. I've added the corner radius setting to the datagrid and the datagrid columns but only the datagrid corners are rounded. The column corners are still square and stick past the rounded datagrid corners. If anyone can help me it would be much appreciated.
    Thanks in advance,
    Xander.

    OK, I have already created and applied a character style with a no-break attribute to all of my equations and propositions (or at least all of the ones I've found so far). This was not done with GREP, because I couldn't figure out how to do it with GREP.
    I have now also created a character style with a 50% scale.
    But I stil don't understand how to use GREP to apply them both. "...if you can establish a pattern to your symbols and spaces that is different from other text" -- if the pattern I've established that's different from other text is the first character style, how do I create a GREP that applies the second character style only to the space character in text where the first character style is applied?
    ~Valerie

  • Want to add some grid styling in my datagrid

    Hi All ,
              In my datagrid i have a requirement in which when ever i do mouse hovering onto a particular read only data grid a link button should gets appended before that row and also the color of the row should also changed to yellow . till this point i am able to achieve the functionality . After that if i move  mouse to that link button which comes as a pop up on hovering of the current row ,  i want to change the color of the row to blue . i tried with giving selction-color and roll-over-color in the style sheet as per required  . but i am facing a problem whenever i am inside the grid the change of color from hovering to selection is happening fine , but as soon as i move my mouse to that link button ,all the color style removed .  And i am not able to control the style of the row from the event handler of the link button .
    then i tried to give all the style to my grid through the renderer . Have any one of you ever come to achieve such requirement . Kindly help me out. 

    I'm not sure what you are trying to do here is possible. As soon as you move the mouse to the pop-up, the row is no longer 'hovered' so it makes sense that any style changes based on being in the 'hovered' state would revert. My suggestion would be to trigger the changes when the row is selected instead. So have an event listener for row selection that sets the row color to yellow, displays the pop-up, and saves a reference to the target row somewhere. Then in the event listener for the link button use the saved reference to the row to change the color to blue.

  • Styling an advanced datagrid

    Hi,
    I need to be able to apply background images to both columns
    and rows in a datagrid. Has anyone managed to do such thing, and if
    so, can you please tell me how you did it?
    Many thanks in advance,
    Gareth

    to remove watermark i have added license key in WEB-INF\flex\license.properties file as key = value

  • Using a DropDownList in a DataGrid, both with dynamically loaded content

    I just bought FlashBuilder 4.5 and even though I have been using ActionScript for years, I am having the hardest time to solve a seemingly simple task:
    I have a database table with names of employees:
    id
    name
    departmentid
    1
    Janet Jackson
    2
    2
    Frank Zappa
    2
    3
    John Travolta
    1
    in another table I have the departments
    id
    Department
    1
    Acting Department
    2
    Music Department
    What I want is a DataGrid with a DropDownList itemRenderer for the Department so that I can selected the Department by name and not by id. This should be a no-brainer (and with HTML and PHP I have done that hundreds of times), but with Flex I can not figure out how to do this. This is what I have done so far:
    Created the DataGrid, generated the database service and dragged it to the datagrid to bind the data. Works.
    Then I created an itemRenderer for departmentid
    In the department itemRenderer I dragged a DropDownList element, created a database service for the departments and dragged it onto that to get the databinding.
    So far, so good. When I start it, I have a populated datagrid with a DropDownList that shows all available departments when I click on it.
    What I need, of course, is that the Department DropDownList now shows the Department of the Employee row. When I change the Department in the DropDownList, it should update the Employee Database table.
    I literally spend now days on trying to figure this out and can't find anything on the Internet that would help me. If you could give me some advise or even show me how the code needs to look, it would be GREATLY appreciated.
    I am pasting here also the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s: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"
                      xmlns:employeeservice="services.employeeservice.*"
                      width="982" height="380" minWidth="955" minHeight="600">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                        getAllEmployeeResult.token = employeeService.getAllEmployee();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllEmployeeResult"/>
              <employeeservice:EmployeeService id="employeeService"
                                                       fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                       showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:DataGrid id="dataGrid" x="52" y="67" width="455"
                        creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
                        requestedRowCount="4">
              <s:columns>
                   <s:ArrayList>
                        <s:GridColumn dataField="id" headerText="id"></s:GridColumn>
                        <s:GridColumn dataField="firstname" headerText="firstname"></s:GridColumn>
                        <s:GridColumn dataField="lastname" headerText="lastname"></s:GridColumn>
                        <s:GridColumn dataField="departmentid" editable="false" headerText="departmentid"
                                         itemRenderer="components.DepartmentDropDownList"></s:GridColumn>
                   </s:ArrayList>
              </s:columns>
              <s:typicalItem>
                   <fx:Object id="id1" departmentid="departmentid1" firstname="firstname1"
                                lastname="lastname1"></fx:Object>
              </s:typicalItem>
              <s:AsyncListView list="{getAllEmployeeResult.lastResult}"/>
         </s:DataGrid>
    </s:Application>
    Here the code of the itemRenderer:
    <?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"
                             xmlns:departmentservice="services.departmentservice.*"
                             width="172" height="34" clipAndEnableScrolling="true">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   override public function prepare(hasBeenRecycled:Boolean):void {
                        lblData.text = data[column.dataField]
                   protected function dropDownList_creationCompleteHandler(event:FlexEvent):void
                        getAllDepartmentResult.token = departmentService.getAllDepartment();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllDepartmentResult"/>
              <departmentservice:DepartmentService id="departmentService"
                                                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                            showBusyCursor="true"/>
         </fx:Declarations>
         <s:Label id="lblData" top="9" left="7"/>
         <s:DropDownList id="dropDownList" x="34" y="5" width="128"
                             creationComplete="dropDownList_creationCompleteHandler(event)"
                             labelField="department">
              <s:AsyncListView list="{getAllDepartmentResult.lastResult}"/>
         </s:DropDownList>
    </s:GridItemRenderer>

    I just bought FlashBuilder 4.5 and even though I have been using ActionScript for years, I am having the hardest time to solve a seemingly simple task:
    I have a database table with names of employees:
    id
    name
    departmentid
    1
    Janet Jackson
    2
    2
    Frank Zappa
    2
    3
    John Travolta
    1
    in another table I have the departments
    id
    Department
    1
    Acting Department
    2
    Music Department
    What I want is a DataGrid with a DropDownList itemRenderer for the Department so that I can selected the Department by name and not by id. This should be a no-brainer (and with HTML and PHP I have done that hundreds of times), but with Flex I can not figure out how to do this. This is what I have done so far:
    Created the DataGrid, generated the database service and dragged it to the datagrid to bind the data. Works.
    Then I created an itemRenderer for departmentid
    In the department itemRenderer I dragged a DropDownList element, created a database service for the departments and dragged it onto that to get the databinding.
    So far, so good. When I start it, I have a populated datagrid with a DropDownList that shows all available departments when I click on it.
    What I need, of course, is that the Department DropDownList now shows the Department of the Employee row. When I change the Department in the DropDownList, it should update the Employee Database table.
    I literally spend now days on trying to figure this out and can't find anything on the Internet that would help me. If you could give me some advise or even show me how the code needs to look, it would be GREATLY appreciated.
    I am pasting here also the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s: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"
                      xmlns:employeeservice="services.employeeservice.*"
                      width="982" height="380" minWidth="955" minHeight="600">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                        getAllEmployeeResult.token = employeeService.getAllEmployee();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllEmployeeResult"/>
              <employeeservice:EmployeeService id="employeeService"
                                                       fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                       showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:DataGrid id="dataGrid" x="52" y="67" width="455"
                        creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
                        requestedRowCount="4">
              <s:columns>
                   <s:ArrayList>
                        <s:GridColumn dataField="id" headerText="id"></s:GridColumn>
                        <s:GridColumn dataField="firstname" headerText="firstname"></s:GridColumn>
                        <s:GridColumn dataField="lastname" headerText="lastname"></s:GridColumn>
                        <s:GridColumn dataField="departmentid" editable="false" headerText="departmentid"
                                         itemRenderer="components.DepartmentDropDownList"></s:GridColumn>
                   </s:ArrayList>
              </s:columns>
              <s:typicalItem>
                   <fx:Object id="id1" departmentid="departmentid1" firstname="firstname1"
                                lastname="lastname1"></fx:Object>
              </s:typicalItem>
              <s:AsyncListView list="{getAllEmployeeResult.lastResult}"/>
         </s:DataGrid>
    </s:Application>
    Here the code of the itemRenderer:
    <?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"
                             xmlns:departmentservice="services.departmentservice.*"
                             width="172" height="34" clipAndEnableScrolling="true">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   override public function prepare(hasBeenRecycled:Boolean):void {
                        lblData.text = data[column.dataField]
                   protected function dropDownList_creationCompleteHandler(event:FlexEvent):void
                        getAllDepartmentResult.token = departmentService.getAllDepartment();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllDepartmentResult"/>
              <departmentservice:DepartmentService id="departmentService"
                                                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                            showBusyCursor="true"/>
         </fx:Declarations>
         <s:Label id="lblData" top="9" left="7"/>
         <s:DropDownList id="dropDownList" x="34" y="5" width="128"
                             creationComplete="dropDownList_creationCompleteHandler(event)"
                             labelField="department">
              <s:AsyncListView list="{getAllDepartmentResult.lastResult}"/>
         </s:DropDownList>
    </s:GridItemRenderer>

  • Could not resolve mx:DataGrid to a component implementation

    I'm very new at this. Building a mobile app. Running the latest Flex/FlashBuilder (4.6). When I compile I get this error: "could not resolve <mx:DataGrid> to a component implementation". Here is my code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- dpcontrols/DataGridPassData.mxml -->
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        title="Jobs List">
              <fx:Script>
                        <![CDATA[
                                  import mx.collections.*;
                                  private var DGArray:Array = [
                                            {Lease:'Bagby Heirs', Well:'1', Location:'Quitman', Customer:'Fair Oil Company', ScheduleDate:'2/23/2012', ServiceDate:'5/16/2012'},
                                            {Lease:'ITU', Well:'301', Location:'Ingram Trinity', Customer:'Southwest Operating, Inc.', ScheduleDate:'3/19/2012', ServiceDate:'4/25/2012'},
                                            {Lease:'ITU', Well:'81', Location:'ITU', Customer:'Southwest Operating, Inc.', ScheduleDate:'3/19/2012', ServiceDate:'4/25/2012'},
                                            {Lease:'Tolliver A', Well:'5', Location:'Turner Town', Customer:'SEDI', ScheduleDate:'4/16/2012', ServiceDate:'5/11/2012'},
                                            {Lease:'W R Cady', Well:'1', Location:'Coffield', Customer:'Green River Resource', ScheduleDate:'5/9/2012', ServiceDate:'4/10/2012'},
                                            {Lease:'Royal National Bar', Well:'2', Location:'Coffield', Customer:'Green River Resource', ScheduleDate:'5/9/2012', ServiceDate:'4/10/2012'},
                                            {Lease:'Pan American L', Well:'1', Location:'Chandler', Customer:'East Texas Oil & Gas', ScheduleDate:'5/14/2012', ServiceDate:'6/8/2012'},
                                            {Lease:'Paluxy B Sand', Well:'5', Location:'West Tyler', Customer:'Culver & Cain', ScheduleDate:'6/1/2012', ServiceDate:'5/25/2012'},
                                            {Lease:'Wh Pittman Hei', Well:'2', Location:'Quitman', Customer:'Southwest Operating, Inc.', ScheduleDate:'7/10/2012', ServiceDate:'6/18/2012'},
                                            {Lease:'Vivian Pruitt', Well:'1', Location:'Crow - Hwy 80M', Customer:'Buffco Productions, Inc.', ScheduleDate:'8/7/2012', ServiceDate:'8/29/2012'}
                                  [Bindable]
                                  public var initDG:ArrayList;
                                  //Initialize initDG ArrayList variable from the Array.
                                  //If you use this technique to process an HTTPService,
                                  //WebService, or RemoteObject result, use an ArrayCollection
                                  //rather than an ArrayList.
                                  public function initData():void {
                                            initDG=new ArrayList(DGArray);
                        ]]>
              </fx:Script>
              <!--s:states>
              <s:State name="loginState"/>
              <s:State name="State1"/>
              </s:states-->
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
                          <fx:Component className="AlertMsgDay">
                                  <s:SkinnablePopUpContainer x="70" y="300">
                                            <s:TitleWindow title="Filtering" close="close()">
                                                      <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="8" paddingRight="8" gap="5" width="100%">
                                                                <s:Label text="This button will filter jobs to show only TODAY."/>
                                                                <s:Button label="OK" click="close()"/>
                                                      </s:VGroup>
                                            </s:TitleWindow>
                                  </s:SkinnablePopUpContainer>
                        </fx:Component>
                        <fx:Component className="AlertMsgWeek">
                                  <s:SkinnablePopUpContainer x="70" y="300">
                                            <s:TitleWindow title="Filtering" close="close()">
                                                      <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="8" paddingRight="8" gap="5" width="100%">
                                                                <s:Label text="This button will filter jobs to show only THIS WEEK."/>
                                                                <s:Button label="OK" click="close()"/>
                                                      </s:VGroup>
                                            </s:TitleWindow>
                                  </s:SkinnablePopUpContainer>
                        </fx:Component>
              </fx:Declarations>
              <s:BorderContainer x="10"  y="111" borderColor="#808080" cornerRadius="5" borderWeight="2" width="98%" height="369">
                        <s:Scroller width="100%" height="363" verticalScrollPolicy="on">
                                  <s:Group width="100%" height="100%">
                                            <mx:DataGrid id="myGrid" width="900" height="350" dataProvider="{initDG}" >  <<<< THE ERROR IS HERE
                                                      <mx:columns>
                                                                <mx:DataGridColumn dataField="Lease" />
                                                                <mx:DataGridColumn dataField="Well" />
                                                                <mx:DataGridColumn dataField="Location" />
                                                                <mx:DataGridColumn dataField="Customer" />
                                                                <mx:DataGridColumn dataField="ScheduleDate" headerText="Schedule Date" />
                                                                <mx:DataGridColumn dataField="ServiceDate" headerText="Service Date" />
                                                      </mx:columns>
                                            </mx:DataGrid>
                                  </s:Group>
                        </s:Scroller>
              </s:BorderContainer>
              <s:Label x="10" y="10" width="96" height="53" fontSize="24" text="Sort by:"
                                   verticalAlign="middle"/>
              <s:Button id="btn_show_today" x="104" y="11" width="105" height="53" label="Today"
                                    fontSize="13" fontWeight="bold" click="(new AlertMsgDay()).open(this, false);"/>
              <s:Button id="btn_show_week" x="216" y="11" width="105" height="53" label="Week"
                                    fontSize="13" fontWeight="bold" click="(new AlertMsgWeek()).open(this, false);"/>
              <s:Button x="348" y="10" width="184" height="53" label="Edit this Job" fontSize="18" click="navigator.pushView(views.JobFormView);"/>
    </s:View>

    I'm very new at this. Building a mobile app. Running the latest Flex/FlashBuilder (4.6). When I compile I get this error: "could not resolve <mx:DataGrid> to a component implementation". Here is my code:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- dpcontrols/DataGridPassData.mxml -->
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        title="Jobs List">
              <fx:Script>
                        <![CDATA[
                                  import mx.collections.*;
                                  private var DGArray:Array = [
                                            {Lease:'Bagby Heirs', Well:'1', Location:'Quitman', Customer:'Fair Oil Company', ScheduleDate:'2/23/2012', ServiceDate:'5/16/2012'},
                                            {Lease:'ITU', Well:'301', Location:'Ingram Trinity', Customer:'Southwest Operating, Inc.', ScheduleDate:'3/19/2012', ServiceDate:'4/25/2012'},
                                            {Lease:'ITU', Well:'81', Location:'ITU', Customer:'Southwest Operating, Inc.', ScheduleDate:'3/19/2012', ServiceDate:'4/25/2012'},
                                            {Lease:'Tolliver A', Well:'5', Location:'Turner Town', Customer:'SEDI', ScheduleDate:'4/16/2012', ServiceDate:'5/11/2012'},
                                            {Lease:'W R Cady', Well:'1', Location:'Coffield', Customer:'Green River Resource', ScheduleDate:'5/9/2012', ServiceDate:'4/10/2012'},
                                            {Lease:'Royal National Bar', Well:'2', Location:'Coffield', Customer:'Green River Resource', ScheduleDate:'5/9/2012', ServiceDate:'4/10/2012'},
                                            {Lease:'Pan American L', Well:'1', Location:'Chandler', Customer:'East Texas Oil & Gas', ScheduleDate:'5/14/2012', ServiceDate:'6/8/2012'},
                                            {Lease:'Paluxy B Sand', Well:'5', Location:'West Tyler', Customer:'Culver & Cain', ScheduleDate:'6/1/2012', ServiceDate:'5/25/2012'},
                                            {Lease:'Wh Pittman Hei', Well:'2', Location:'Quitman', Customer:'Southwest Operating, Inc.', ScheduleDate:'7/10/2012', ServiceDate:'6/18/2012'},
                                            {Lease:'Vivian Pruitt', Well:'1', Location:'Crow - Hwy 80M', Customer:'Buffco Productions, Inc.', ScheduleDate:'8/7/2012', ServiceDate:'8/29/2012'}
                                  [Bindable]
                                  public var initDG:ArrayList;
                                  //Initialize initDG ArrayList variable from the Array.
                                  //If you use this technique to process an HTTPService,
                                  //WebService, or RemoteObject result, use an ArrayCollection
                                  //rather than an ArrayList.
                                  public function initData():void {
                                            initDG=new ArrayList(DGArray);
                        ]]>
              </fx:Script>
              <!--s:states>
              <s:State name="loginState"/>
              <s:State name="State1"/>
              </s:states-->
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
                          <fx:Component className="AlertMsgDay">
                                  <s:SkinnablePopUpContainer x="70" y="300">
                                            <s:TitleWindow title="Filtering" close="close()">
                                                      <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="8" paddingRight="8" gap="5" width="100%">
                                                                <s:Label text="This button will filter jobs to show only TODAY."/>
                                                                <s:Button label="OK" click="close()"/>
                                                      </s:VGroup>
                                            </s:TitleWindow>
                                  </s:SkinnablePopUpContainer>
                        </fx:Component>
                        <fx:Component className="AlertMsgWeek">
                                  <s:SkinnablePopUpContainer x="70" y="300">
                                            <s:TitleWindow title="Filtering" close="close()">
                                                      <s:VGroup horizontalAlign="center" paddingTop="8" paddingBottom="8" paddingLeft="8" paddingRight="8" gap="5" width="100%">
                                                                <s:Label text="This button will filter jobs to show only THIS WEEK."/>
                                                                <s:Button label="OK" click="close()"/>
                                                      </s:VGroup>
                                            </s:TitleWindow>
                                  </s:SkinnablePopUpContainer>
                        </fx:Component>
              </fx:Declarations>
              <s:BorderContainer x="10"  y="111" borderColor="#808080" cornerRadius="5" borderWeight="2" width="98%" height="369">
                        <s:Scroller width="100%" height="363" verticalScrollPolicy="on">
                                  <s:Group width="100%" height="100%">
                                            <mx:DataGrid id="myGrid" width="900" height="350" dataProvider="{initDG}" >  <<<< THE ERROR IS HERE
                                                      <mx:columns>
                                                                <mx:DataGridColumn dataField="Lease" />
                                                                <mx:DataGridColumn dataField="Well" />
                                                                <mx:DataGridColumn dataField="Location" />
                                                                <mx:DataGridColumn dataField="Customer" />
                                                                <mx:DataGridColumn dataField="ScheduleDate" headerText="Schedule Date" />
                                                                <mx:DataGridColumn dataField="ServiceDate" headerText="Service Date" />
                                                      </mx:columns>
                                            </mx:DataGrid>
                                  </s:Group>
                        </s:Scroller>
              </s:BorderContainer>
              <s:Label x="10" y="10" width="96" height="53" fontSize="24" text="Sort by:"
                                   verticalAlign="middle"/>
              <s:Button id="btn_show_today" x="104" y="11" width="105" height="53" label="Today"
                                    fontSize="13" fontWeight="bold" click="(new AlertMsgDay()).open(this, false);"/>
              <s:Button id="btn_show_week" x="216" y="11" width="105" height="53" label="Week"
                                    fontSize="13" fontWeight="bold" click="(new AlertMsgWeek()).open(this, false);"/>
              <s:Button x="348" y="10" width="184" height="53" label="Edit this Job" fontSize="18" click="navigator.pushView(views.JobFormView);"/>
    </s:View>

  • Datagrid column header split

    Greetings,
    I am using flashbuilder 4.5 for php premium.    I have a datagrid and need
    to have multiple column headers some spanning others.  I found an
    example that has multiple header/iterm renderers, but it is for the mx:datagrid,
    not the spark.  The example calls it SplitDataGridHeader.   Is there a way to
    do this with a spark (s:datagrid) without all the extra?
    The following is an image of the mx version running:
    thanks.

    @Johnny,
    Try to make use of the headerRenderer property and use <mx:Text /> control as a renderer so that your headerText gets wrapped..
    Thanks,
    Bhasker
    Message was edited by: BhaskerChari

  • MX DataGrid Footer row working in FB 4.5

    Can someone please provide a sample of having a footer row for mx datagrid working in FB 4.5?
    Thanks

    Thanks for the info rangora!
    I am trying to work with a tutorial creating a mobile twitter app
    (http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flex/articles/twitter -trends/build-first-mobile-flex-app.pdf)
    Following the tutorial:..
    Trying to connect  the data service with the url he gives (http://search.twitter.com/trends.json)
    returns 404 not found... URL changed since tutorial was made maybe? I dont know?
    So went to twitter here (https://dev.twitter.com/docs/api/1/get/trends) and used this
    (http://api.twitter.com/1/trends.json)
    and was connected via flashbuilder test. ok good.
    The tutorial has me set the name of the app in the properties dialouge under common as "twitter trends" then
    continue on,  and set debug configurations then run.
    The app never connects..... and allways shows.. "Home View" as the title.??( I named the app twitter trends in the wizaed setup and in properties )
    I am sure you can tell by now I am new to  flash builder!
    Also Red Circle with X in gutter.. shows within the view file's source page,  (not the application File) stating---   "Cannot resolve attribute 'viewActive' for component type spark.components.View". this occurs after trying to insert  viewActive="refresh()"  into the <s:view> tag,  in which the tutorial calls for this to be done to refresh the page view when using the "back control" in the app.(switching views)
    4.5 returns red X error saying.. parse error.. must be inside <fx:declaration> tag...  so I put it in there,  and
    4.5  returns error ... cannot follow <s: callresponder>.(which is inside the declaration tag) so I moved it between the </fx:script tag>
    and the <fx:Declarations> tag> and still the same error statement....huh...it is not inside the declarations tag anymore and still in the s:view tag's scope, just lower in the page.
    hoping to find some kind of answer to this.
    "just trying to learn"
    Thanks

  • DataGrid to PHP to MySQL?

    I'm working with FlashBuilder 4 b2. It is doing some wonderful things, but I am having trouble getting my app to send data back to the database table. It reads it just fine. I want to update the data in a dataGrid then update the database with the dataGrid contents.  I am using PHP and MySQL on a local server.  Where can I find an example of the Actionscript 3 and PHP code to get it to work? Thanks!

    Hi,
    You have to use <service instance id>.commit() instead of <service class name.>
    For example,
    My generated code looks like this,
    <fx:Declarations>
            <s:CallResponder id="getAllEmployeesResult"/>
            <employeesservice:EmployeesService id="employeesService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    So in my button click handler function, I have to make a call, "employeesService.commit() "
    Note that i have used the id property of EmployeeService. Let me know if it helps.
    Thanks,
    Radhakrishna

  • Spec posted: Styling Gumbo Components

    An older specification on styling has been posted to the flex open source site:
    http://opensource.adobe.com/wiki/display/flexsdk/Styling+Gumbo+Components

    I believe all scrolling is smooth scrolling now, it’s up to the scrollbar what increment it will be moving.  I think we discuss this more in the specs.
    On 4/2/09 2:11 AM, "Iwo Banas" <
    [email protected]> wrote:
    A new message was posted by Iwo Banas in
    Developers --
      Spark Virtualization spec posted
    The idea of generic layout virtualization is great!
    I am not sure if it is a correct place but it would be nice if scrolling management could be implemented in a similarly generic way.
    I mean choice between smooth scrolling and jumping the whole items height (or width) like in halo List or DataGrid.
    Do you think it is possible to add such functionality?
    Cheers,
    Iwo Bana¶
    View/reply at Spark Virtualization spec posted <
    http://www.adobeforums.com/webx?13@@.59b8747c/1>
    Replies by email are OK.
    Use the unsubscribe <
    http://www.adobeforums.com/webx?280@@.59b8747c!folder=.3c060fa3>  form to cancel your email subscription.

Maybe you are looking for