Playing with the spark datagrid

I'm Playing with the spark datagrid and have a column set up like so:
<GridColumn  width="140" headerText="Margin" headerText.editMode="Margin (editing)" dataField="margin" editable="false"  editable.editMode="true" itemRenderer="gridColumnRenderer" >
           </GridColumn>
I would like the item render to change colour based on the state of the outerDocuent, is this possible?
I tried this but can't get to the outerdocument
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:s="library://ns.adobe.com/flex/spark"
                xmlns:mx="library://ns.adobe.com/flex/mx"
                autoDrawBackground="true">
    <s:Label text="{data.margin}" backgroundColor="{   outerDocument.currentState =='editMode'?0xffffff:0xdddddd}"/>
</s:ItemRenderer>

I believe you will need to use GridItemRenderer instead of ItemRenderer as your base class for renderers in the spark DataGrid.  Does it work if you change to that?

Similar Messages

  • When I buy a pre order song how do I get it to play with the rest of the CD?

    When I buy a pre-order song from i tunes, and then purchase the CD the song was from it will not play with the rest of the CD.
    Example: Tori Amos's new CD Unrepentant Geraldines
    I purchased the single Trouble's Lament when it was released, before the CD.
    I just purchased the CD and the song should be #2 on the CD, but its not there, it is listed separately, and will not play with the CD.
    Also, other issue... Free U2 CD, it says its in my Library when I clicked on the CD add in the store. It's nowhere to be found in my library!! I really would love to listen to it since I have several of there CD's and am a big fan
    If anyone can help with either of these issues , I would greatly appreciate it.

    For the single, if you select the track in your library and do 'get-info' (control-I) on it and select its Summary tab on the popup are its details (e.g. album name and artist) the same as for the other tracks on the album ?
    For the U2 album you should be able to download it into your library by ticking the 'show iTunes in the Cloud purchases' tick box on the Store tab in iTunes > Preferences - it should then show in the Music part of your library with a cloud icon against it for downloading (downloading the booklet for it this way may not work, you may get a 'corrupt file' message when trying to open it, though that might have been fixed by now).
    Or go to the Purchased link under Quick Links on the right-hand side of the iTunes store homepage and you should be able to download it from there.
    A third option is to sign out of your account (Store > Sign Out menu option), find the album in the store and then click on its free 'price' button - you should then be prompted to sign back in and the album should download.

  • I transfer all my games from my iphone to my pad, but the game progress is lost.... i signed on to game centre it shows all my scores and progress but when i try to play with the games, all my progress and scores disappears... can anyone help???

    I transfered all my games from my iphone4s to my ipad, but the game progress is lost.... I signed on to game centre it shows all my scores and progress but when i try to play with the games, all my progress and scores disappears... can anyone help???

    Hi bubbles213,
    The best way to move information from one iOS device to another is to back up the device using iCloud or iTunes (or both), and then restoring the new device from it.  This article will walk you through the steps:
    Transfer content from an iPhone, iPad, or iPod touch to a new device
    http://support.apple.com/kb/HT2109
    Cheers,
    - Judy

  • [svn:fx-trunk] 5019: ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/ AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spa

    Revision: 5019
    Author: [email protected]
    Date: 2009-02-19 13:17:21 -0800 (Thu, 19 Feb 2009)
    Log Message:
    ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spark equivs
    QE Notes: None
    Doc Notes: None
    Bugs: -
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as

    Hi DST
    This is a great effort and gesture. thank you on behalf of all the newbies.
    PJ

  • I just to a new iphone5s, the headphones are not working correctly. I can hear the music but I can't pause or play with the button. Will apple replace them?

    I just bought a new iphone5s, the headphones are not working correctly. I can hear the music but I can't pause or play with the button. Will apple replace them?

    Hi there,
    It sounds like your purchased content is not transfering via a flash drive. It may be easier to re-download this contnet directly from iTunes. Take a look at the article below for mor information.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    -Griff W.

  • My iPad is constantly displays 'find my iPad alert OK' after my daughter was playing with the find iPhone app.  How can I unlock the iPad?

    My iPad is constantly displays 'find my iPad alert OK' after my daughter was playing with the find iPhone app.  How can I unlock the iPad?

    My iPad is constantly displays 'find my iPad alert OK' after my daughter was playing with the find iPhone app.  How can I unlock the iPad?

  • HT4962 Are there any movies or tv shows that can be played with the Touch?

    Are there any movies or tv shows that can be played with the ITouch?  Attempted to download a tv show, however was advised it was not supported.  Is there a way to configure the show to be played?

    See:'
    iTunes: Frequently asked questions about viewing and syncing videos
    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
    There are third-party converters like the Free HandBrake program.

  • Inserted a png PIP into my clip, can see it fine, can see it playing with the clip as expected when moving the play head manually, but cannot get it to play with the clip for preview, pleas help!

    I am sorry if my inquiry here seem dumb but I am a new iMovie user and cannot figure this out.  I inserted a png image into my video clip in the project as PIP, I can see it and move it and can also see it playing with the main clip if I move the play head manually, I can also see the PIP part only playing along with the undelying main clip if I use the Play button in the preview window when the PIP section is selected, however, for the life of me I cannot get it to play with the main clip all together for previewing the entire video via the video play button.  What happens is that the video plays normally and when the PIP section comes in, the video clip stop all motion during the duration of the PIP section and the PIP image itself is simply NOT showing.  Am I missing something really stupid here?  It seems as it the Picture On Picture is a separate clip that plays with the underlying main video clip if selected and played by itself but it is not part of the video clip and will not play with it.  What am I missing here, can anyone please help?
    Shony

    The easiest way to get up and running is to convert your MP3s to MP4s (obviously there won't be a video track). The following link links to a file that was an MP3 that I converted to an MP4 using QT Player Pro. When you go to export the files, make sure you click on "Options" and then check the box for "Enable Streaming" in the Streaming tab. It should stream flawlessly using QT Player. rtsp://rhsstreamit.rih.org/testmp4/Scorpion.mp4
    Make sure you place the media to be streamed in the proper folder. You should only get a "404" message if the physical file doesn't exist.
    Good luck!

  • My ipod is stuck on hold mode....i tried plugging into a power source but it doesn't respond and iTunes doesn't recognize it...i also tried playing with the hold key but nothing happens...i have a iPod classic plz help :(

    my ipod is stuck on hold mode....i tried plugging into a power source but it doesn't respond and iTunes doesn't recognize it...i also tried playing with the hold key but nothing happens...plz help

    Have you tried holding the centr button and menu. This will force a shutdown.

  • Do purchased karaoke songs play with the words to sing by

    do purchased karaoke songs play with the words to sing by

    No.
    I've never bought any but I'm sure I would have found/heard of such a feature if it existed. iTunes has limited support for including lyrics as text via Get Info., but does not support synchronized lyrics, let alone the full syllable-by-syllable highlighting that can be achieved.
    tt2

  • What is the point of [Bindable("selectionChange")] in parts of the spark datagrid class?

    I dont understand the point of this code in the spark datagrid class:
    what is the point of this:
        [Bindable("selectionChange")]
         [Bindable("valueCommit")]
         [Inspectable(category="General", defaultValue="null")]
    in
        //  selectedItem
        [Bindable("selectionChange")]
        [Bindable("valueCommit")]
        [Inspectable(category="General", defaultValue="null")]
         *  @copy spark.components.Grid#selectedItem
         *  @default null
         *  @langversion 3.0
         *  @playerversion Flash 10
         *  @playerversion AIR 2.5
         *  @productversion Flex 4.5
        public function get selectedItem():Object
            if (grid)
                return grid.selectedItem;
            return (dataProvider && (selectedIndex > 0)) ?
                dataProvider.getItemAt(selectedIndex) : undefined;
         *  @private
        public function set selectedItem(value:Object):void
            if (grid)
                grid.selectedItem = value;
            else
                var f:Function = function(g:Grid):void
                    g.selectedItem = value;
                deferredGridOperations.push(f);

    Anything that is binding to selectedItem will go get the value again when either of those events fires.

  • HT200126 My kid played with the update on my Apple TV. Now it can't play anymore. There is an image on the scrren showing needing connectiong to iTunes. Please show me what to do next. Thanks.

    My kid played with the update on my Apple TV. Now it can't play anymore. There is an image on the scrren showing needing connectiong to iTunes. Please show me what to do next. Thanks.

    Plug the Apple TV into your computer and do a restore if it doesn't happen automatically.

  • Why the game: Injustice, when play with the challenge will direct close the game? Please fix it.

    Why the game: Injustice, when play with the challenge will direct close the game? Please fix it.

    You need to speak to the developer. They should have some sort of contact link on their iTunes page.  This is just a user to user tech support forum, no one here has any sort of control over apple or what developers do.
    The game developer may also have some sort of fix on their site, so look there.

  • Selection issue with editable Spark DataGrid

    Hi everyone,
    I am evaluating the new Spark DataGrid and I'm having a very strange issue with the behavior of selection in an editable instance.
    Here is my test application: http://www.playcalliope.com/flex/DataGridSelectionIssue.html (code here: https://gist.github.com/1129160)
    And here are the steps to reproduce the issue:
    select the very first cell at the top-left corner of the grid (the one with "Gabriele");
    click on it once more, the editor appears;
    now click on the cell just to the right of it (the one with "Genta").
    You should see that editing ends as it supposed to do, but selection is placed on the third cell (the one with a 5 in it) instead on the one you clicked on. Playing a little with the grid you should see that this isn't the only case, but selection is really behaving randomly.
    I am using SDK 4.5.1.21328.
    I think this is a very basic usage case.. I can't believe this is not working properly, what am I missing?
    Thanks a lot,
    Gabriele Genta
    Message was edited to add live example

    Your running into a known bug, https://bugs.adobe.com/jira/browse/SDK-30088.
    The  bug will be fixed in the Mega release. To work around the bug you can  create a custom editor and remove the  "dataGrid.validateNow();" call in  DataGridEditor.save().
    Here's how I modified your example to workaround the bug:
    <?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"
                   minWidth="955" minHeight="600"
                   backgroundColor="#E7E7E7"
                   creationComplete="application1_creationCompleteHandler(event)">
        <s:layout>
            <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
        </s:layout>
        <fx:Script>
            <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.events.FlexEvent;
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                    testGrid.dataProvider = new XMLListCollection(testData.item);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="testData" xmlns="">
                <items>
                    <item>
                        <id>1</id>
                        <cognome>Gabriele</cognome>
                        <nome>Genta</nome>
                        <uhm>5</uhm>
                        <bene>molto</bene>
                    </item>
                    <item>
                        <id>10</id>
                        <cognome>Pinco</cognome>
                        <nome>Pallino</nome>
                        <uhm>10</uhm>
                        <bene>poco</bene>
                    </item>
                </items>
            </fx:XML>
            <fx:Component className="MyDefaultEditor">
                <s:DefaultGridItemEditor>
                    <fx:Script>
                        <![CDATA[
                            import mx.collections.ICollectionView;
                            import mx.collections.ISort;
                            override public function save():Boolean
                                if (!validate())
                                    return false;
                                var newData:Object = value;
                                var property:String = column.dataField;
                                var data:Object = data;
                                var typeInfo:String = "";
                                for each(var variable:XML in describeType(data).variable)
                                    if (property == [email protected]())
                                        typeInfo = [email protected]();
                                        break;
                                if (typeInfo == "String")
                                    if (!(newData is String))
                                        newData = newData.toString();
                                else if (typeInfo == "uint")
                                    if (!(newData is uint))
                                        newData = uint(newData);
                                else if (typeInfo == "int")
                                    if (!(newData is int))
                                        newData = int(newData);
                                else if (typeInfo == "Number")
                                    if (!(newData is Number))
                                        newData = Number(newData);
                                else if (typeInfo == "Boolean")
                                    if (!(newData is Boolean))
                                        var strNewData:String = newData.toString();
                                        if (strNewData)
                                            newData = (strNewData.toLowerCase() == "true") ? true : false;
                                if (property && data[property] !== newData)
                                    // If the data is sorted, turn off the sort for the edited data.
                                    var sort:ISort = null;
                                    if (dataGrid.dataProvider is ICollectionView)
                                        var dataProvider:ICollectionView = ICollectionView(dataGrid.dataProvider);
                                        if (dataProvider.sort)
                                            sort = dataProvider.sort;
                                            dataProvider.sort = null;
                                    var oldData:Object = data[property];
                                    data[property] = newData;
                                    dataGrid.dataProvider.itemUpdated(data, property, oldData, newData);
                                    // Restore the sort. The data will not be sorted due to this change.
                                    if (sort)
                                        ICollectionView(dataGrid.dataProvider).sort = sort;
                                return true;
                        ]]>
                    </fx:Script>               
                </s:DefaultGridItemEditor>
            </fx:Component>
        </fx:Declarations>
        <s:DataGrid id="testGrid" width="100%" height="100%"
                    editable="true" selectionMode="singleCell"
                    itemEditor="{new ClassFactory(MyDefaultEditor)}">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn headerText="Prova" dataField="cognome"/>
                    <s:GridColumn headerText="Prova1" dataField="nome"/>
                    <s:GridColumn headerText="Prova3" dataField="uhm"/>
                    <s:GridColumn headerText="Prova4" dataField="bene"/>
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>
    </s:Application>

Maybe you are looking for

  • Mac book pro cut off

    Mac book pro cut off and will not come back on at all...tried all the options in the manual and nothing works..plugged up to battery adapter and the green indicator light is very dim. Any suggestions?

  • When restoring iPod...error occurs

    I'm trying to reformat my iPod from Mac to PC, but something keeps popping up that says: iTunes could not contact the iPod software update server because you are not connected to the internet But I am connected...I'm typing on this forum aren't I?

  • How can I get my ipod to sync on my new laptop?

    I have downloaded the latest version of itunes on my new laptop and my ipod won't sync, it does not seem to be recognised by itunes tho' it is in my computer. I have reset the ipod but that hasn't worked. I have been advised to restore my ipod to its

  • When using CORBA I get an Attribute validation error for CFOBJECT

    Any ideas about whats going on here? The value of the TYPE attribute, which is currently "CORBA", must be one of the values: CORBA,COM,COMPONENT,JAVA,DOTNET,WEBSERVICE,.NET.

  • Three-tier model howto

    Hi... i�m newbie in Java. I am supossed to create an application using three-tier model, i have made it using two-tier model. Can anybody give me a hand with the code, I need an example to start i can not fiugre this out. The application needs to int