Tracking a 'visited' status in grid item renderer

I have a datagrid where some columns are displayed with a custom renderer to make the text in that cell look like traditional web page hyperlinks (i.e. blue color, underline, handcursor on hover, etc.).  The renderer uses a Label, with the desired styling to make it look like a hyperlink.
I would like to have a way so that if a user has clicked the link, the color could be changed to make it look like a 'visited' link (for example, change the color to purple).  However since the renderer is used in a datagrid which means that the renderer may be recycled/reused when scrolling, the information about whether or not the link has been clicked cannot be stored within the renderer.  There isn't an easy way to store the visited status in the underlying data object either, because it is XML and because there may be any number of the fields in each row that could be displayed as hyperlinks.
Any ideas on ways this might be possible to do?

It depends on what the final goal is.
You can certainly create some record of links visited in your app via some Singleton or by subclassing the DataGrid and storing visited links there.  That should be easy to do, but the set of visited links will not be kept between runs.
So then, you can store the set of links visited in a SharedObject and restore them again later.  That’s also relatively easy, but more work.
Now if someone hits the same URL from the browser outside your app, the browser remembers, but your app won’t know that.  I believe that is still a hard problem to get the visited links from the browser.

Similar Messages

  • Item renderer concept in Grid - Grid ITem

    Hi All,
         I am using grid, grid items in my app to generate a view. I can not attain that view using datagrid control. So i want to speed up processing in my layout.
    When i give data to my layout (using grid - grid item) it takes enarmous time to load. It adds lot of weight to my app. App get hanged while scrolling. Is there any possibility to acheive item renderer concept in my Grid - Grdi item layout.
    Note: currently using Flex 3.2 for this. Ready to switch to Flex 4.5 if it is possible. But need to use mx component.
    Sathyamoorthi.

    Thanx for reply.But this is not what i am looking for.I need
    to apply different colors for each bars.I am generating charts
    dynamically.The item renderer is working fine.But at specific
    condition the item renderer shold ne removed from the chart series

  • Item Renderer in Advanced Data Grid

    I have checkbox against each folder in the datagrid and
    binded to XMLListCollection. When the value in the field is true, i
    want that checkbox to be selected. Its not working. Here is the
    code. I want to know how item render is working in AdvancedDataGrid
    Thanks in advance.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    import mx.collections.HierarchicalData;
    import mx.collections.XMLListCollection;
    ]]>
    </mx:Script>
    <mx:XMLList id="dpHierarchyXML" >
    <Clegs>
    <Cleg name="Cleg1" sel="true">
    <FlightLeg createdDate="10/10/2008"
    effectiveDate="10/10/2008"
    endDate="10/10/2008" modifiedDate="10/12/2008"
    station="ATL" carrier="Delta"
    flightNo="9W756" acType="122"
    beginDate="10/10/2008" timeRange="10"
    doop="123" region="XYZ"
    year_duration="0.24" moons="0"
    cost="1250"
    />
    </Cleg>
    <Cleg name="Cleg2" sel="true">
    <FlightLeg createdDate="10/10/2008"
    effectiveDate="10/10/2008"
    endDate="10/10/2008" modifiedDate="10/12/2008"
    station="ATL" carrier="Delta"
    flightNo="9W756" acType="122"
    beginDate="10/10/2008" timeRange="10"
    doop="123" region="XYZ"
    year_duration="0.24" moons="0"
    cost="1250"
    />
    </Cleg>
    </Clegs>
    </mx:XMLList>
    <mx:AdvancedDataGrid
    id="adg"
    dataProvider="{new HierarchicalData(dpHierarchyXML.Cleg)}"
    rowCount="20"
    width="100%"
    treeColumn="{leg}"
    variableRowHeight="true"
    wordWrap="true" dropEnabled="true" dragEnabled="true"
    dragMoveEnabled="true" sortExpertMode="true"
    >
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="@sel"
    headerText=" " width="25" rendererIsEditor="true"
    editable="true" editorDataField="selected" />
    <mx:AdvancedDataGridColumn dataField="@name" id="leg"
    headerText="cLeg" />
    <mx:AdvancedDataGridColumn dataField="@createdDate"
    headerText="Created Date" />
    <mx:AdvancedDataGridColumn dataField="@effectiveDate"
    headerText="Effective Date" />
    <mx:AdvancedDataGridColumn dataField="@endDate"
    headerText="End Date" />
    <mx:AdvancedDataGridColumn dataField="@modifiedDate"
    headerText="Modified Date" />
    <mx:AdvancedDataGridColumn dataField="@station"
    headerText="Station" />
    <mx:AdvancedDataGridColumn dataField="@carrier"
    headerText="Carrier" />
    <mx:AdvancedDataGridColumn dataField="@flightNo"
    headerText="Flight No" />
    <mx:AdvancedDataGridColumn dataField="@acType"
    headerText="Account Type" />
    <mx:AdvancedDataGridColumn dataField="@beginDate"
    headerText="Begin Date" />
    <mx:AdvancedDataGridColumn dataField="@timeRange"
    headerText="Time Range" />
    <mx:AdvancedDataGridColumn dataField="@doop"
    headerText="DOOP" />
    <mx:AdvancedDataGridColumn dataField="@region"
    headerText="Region" />
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider columnIndex="0"
    columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
    </mx:AdvancedDataGridRendererProvider>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Application>

    2) You do not set an item editor only an item renderer.
    <mx:AdvancedDataGridRendererProvider columnIndex="0"
    columnSpan="1" depth="1" renderer="mx.controls.CheckBox">
    3) You do not have rendererIsEditor on any columns that I can
    see.
    <mx:AdvancedDataGridColumn dataField="@sel"
    headerText=" " width="25" rendererIsEditor="true"
    editable="true" editorDataField="selected"/>
    If I use the itemrender for that column, i am gettting the
    check box for all the rows. Which i dont want . I want check box
    only for the folder node. so i am using renderer provider
    I want only one column to be editable

  • Problems regarding a cutoms item renderer

    Hello,
    I have created a custom item renderer whcih contains two labels and a button. this list is populated on a sertain event. but this list behaves very weird when the triggering event is triggered second time and so on.
    What happens is the content set to labels labelFuntion are chaned or changes their place if I set them dynamically. And they do not change even if I want to when they are placed statically. I am attaching my code  herewith
    <?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"
                    left="5"  autoDrawBackground="false"  creationComplete="_initializeHandler(event)"
                    fontSize="12" fontWeight="bold" resize="itemrenderer1_resizeHandler()"
                    width="100%"  cachePolicy="on">
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.events.FlexEvent;
                import mx.events.ResizeEvent;
                import mx.managers.PopUpManager;
                import skins._alert;
                import skins.creoCustomButtons;
                import skins.logoutConf;
                import spark.components.CheckBox;
                import spark.events.PopUpEvent;
                private var but:Button;
                private var a:_alert;
                public var timer2:Timer;
                import spark.components.Button;
                private var cb:CheckBox;
                private var confirmation:logoutConf;
                private var tempo:String;
                public static var _temp_array:Array = new Array();
                import skins.radioButtonList;
                public var _billingCycle:radioButtonList;
                public var subOptions:ArrayCollection;
                [Bindable]public var initiator:int = 0;
                public static var config_data_Temp:ArrayCollection = new ArrayCollection();
                public static var counter:int = new int();
                public function confirmAction(event:MouseEvent):void{
                    //    config_data_Temp.removeItemAt(data.subOptions[this.data].name);
                    subOptions = new ArrayCollection(data.subOptions);
                    _billingCycle = new radioButtonList;
                    _billingCycle.dataProvider = subOptions;
                    _billingCycle.labelField = "name";
                    _billingCycle.width = stage.width;
                    _billingCycle.height = stage.height ;
                    _billingCycle.addEventListener(PopUpEvent.CLOSE, selectedValue);
                    _billingCycle.open(this,true);
                public function selectedValue(event:PopUpEvent):void{
                    if(event.commit){
                        var selectedItems:Vector.<Object> = event.data as Vector.<Object>
                        for(var i:int = 0; i<GlobalData.configurations_data.length; i++){
                            var tempo:String = GlobalData.configurations_data.getItemAt(i,0).toString();
                            //if(config_data_Temp[i]==this.name)
                            if(tempo==btn.label.toString())
                                GlobalData.configurations_data.removeItemAt(i);
                                GlobalData.configurations_data.addItemAt(selectedItems[0].name, i);
                                _price.text = GlobalData.configurations_data[i].price;   
                        type.text = selectedItems[0].name;
                        btn.label = selectedItems[0].name;
                        //GlobalData.configurations_data = null;
                        //GlobalData.configurations_data = config_data_Temp;
                private function processRequest(event:PopUpEvent):void{
                    if(event.commit)
                        _temp_array.push(data.domain_name+data.tldname);
                        GlobalData.domain_name_data = _temp_array;
                        a = new _alert();
                        a.title = "Request Status";
                        a.message = "Your request is successfully processed.\n Check you email account for details";
                        a.open(this.parent, true);
                        PopUpManager.centerPopUp(a);
                        timer2 = new Timer(2000, 1);
                        timer2.addEventListener(TimerEvent.TIMER_COMPLETE,timerComplete2);
                        timer2.start();
                Timer coplete event closing the current displayed popup
                text="{data.subOptions[0].optFees}"
                label="{data.subOptions[0].name}"
                public function  timerComplete2(event:TimerEvent):void
                    a.close()
                public function itemrenderer1_resizeHandler():void{
                    if(but){
                        but.x = (this.parent.width-but.width)-10;
                    if(confirmation)
                        PopUpManager.centerPopUp(confirmation);
                    if(a)
                        PopUpManager.centerPopUp(a);
                public var myButon:Button;
                protected function _initializeHandler(event:FlexEvent):void
                    btn.label = data.subOption[0].name;
            ]]>
        </fx:Script>
        <s:HGroup height="30" width="100%" verticalAlign="middle" gap="0">
            <s:Label width="30%" text="{data.name}"
                     fontSize="10" fontWeight="normal" id="type"/>
            <s:Label  id ="_price" width="10%"
                     fontSize="10" fontWeight="normal"/>
            <s:Button  fontSize="12" fontWeight="normal"
                      skinClass="skins.creoCustomButtons" chromeColor="#ffffff"
                      click="confirmAction(event)" width="60%"  id="btn"/>
        </s:HGroup>
    </s:ItemRenderer>
    NOTE: [ Please ignore comments and import statements ]
    The button pops up a radio button list. After an item is clicked the selected text should be placed on button permenantly, which is not happening in current scenario.
    Any kind of help is appreciated! 

    Hi Karthik
             to where u are dragging this record from grid...? the second component also ready to accept the same type of records when u drag form grid to second component.. that is the scenario..

  • Problem with checkbox item renderer in datagrid

    I have a data grid having check box as an item renderer. I have viewed many posts in this forum but nothing useful in my case. I am failed to bind my datagrid itemrenderer checkbox with the field of dataprovider i.e. listUnitMovement.CHECK_PATH. Then I have to traverse data provider to check which checkboxes are checked.
    [Bindable]
    var listUnitMovement:XMLList=null;                      
    In a function call
    public function init(event:ResultEvent):void
        listUnitMovement=event.result.unitmovement;
         <mx:DataGrid id="dg_country"
                               dataProvider="{listUnitMovement}"
                                  enabled="true">
                                <mx:columns>
                                   <mx:DataGridColumn>
                                        <mx:itemRenderer>
                                            <mx:Component>
                                                <mx:CheckBox selectedField="CHECK_PATH"  />
                                            </mx:Component>                                       
                                        </mx:itemRenderer>
                                    </mx:DataGridColumn>
                                    <mx:DataGridColumn headerText="Latitude" dataField="NEW_LAT" visible="false"/>
                                    <mx:DataGridColumn headerText="Longitude" dataField="NEW_LONG" visible="false"/>
                                   <mx:DataGridColumn>
                                        <mx:itemRenderer>
                                            <mx:Component>
                                                <mx:Button label="Details"/>
                                            </mx:Component>                                       
                                        </mx:itemRenderer>
                                    </mx:DataGridColumn>
                                </mx:columns>
                            </mx:DataGrid>

    Hi,
    Do you want to just check/uncheck the checkboxes based on the CHECK_PATH field.
    Do you want something like this...
    <?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
     <mx:Script>
    <![CDATA[
     import mx.collections.ArrayCollection;[
    Bindable] 
    private var listUnitMovement:ArrayCollection = new ArrayCollection([{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:false,NEW_LAT:133.233,NEW_LONG:702.22}]);]]>
    </mx:Script>
     <mx:DataGrid dataProvider="{listUnitMovement}">
     <mx:columns>
     <mx:DataGridColumn>
     <mx:itemRenderer>
     <mx:Component>
     <mx:CheckBox selectedField="CHECK_PATH" change="data.CHECK_PATH=selected" />
     </mx:Component>  
    </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn dataField="NEW_LAT"/>
     <mx:DataGridColumn dataField="NEW_LONG"/>
     </mx:columns>
     </mx:DataGrid>
    </mx:Application>
    Please let me know clearly what's your problem...Do you want to just bind the check box based on XmlList or something else..?
    Thanks,
    Bhasker Chari.S

  • How to overlap datagrid colums line with item renderer

    Hello guys I been stuck for a few days now and I'm wondering if there is a better way to do this.
    I put an item renderer on a column of the datagrid. The renderer basically expands the column height and shows some controls.
    Im using a border container as the container that is holding the items in the grid. However what I would like to do is make the border container as big as the grid with a plus sign button. and then basically hide that  rows vertical grid lines.
    i tried setting the depth eventhought i understant this is not a spark grid i though it should work but it does not. Any tip or direction would be greatly appreciated.
    Miguel

    ok i answered my own question. what i need to do is use the advance datagrid. Then set these properties.
    <mx:AdvancedDataGrid defaultLeafIcon="{null}"
                             folderClosedIcon="{null}"
                             folderOpenIcon="{null}"
                             disclosureClosedIcon="@Embed(source='assets/plusSign.png')"
                             disclosureOpenIcon="@Embed(source='assets/plusSign.png')">
    Message was edited by: miguel8312

  • Getting the value of a checkbox in an item renderer?

    I have a list that uses an item renderer with buttons and data.  I need to add a checkbox and get the value of this checkbox passed along with the event of the pushbutton.
    When the user clicks "add to menu: there is a click handler:
    protected function addButton_clickHandler(event:MouseEvent):void
                        doubleIt = double.selected;
                        owner.dispatchEvent(new Event("ADD_TO_MENU", true));
    Back in the main application, there is a listener for this event.  I want that handler to be able to "know" the status of that checkbox (i.e. the value of "doubleIt", defined as a public boolean).
    private function addToMenuHandler(event:Event):void {
               var i:int = event.target.selectedIndex;
               var obj:Object = new Object();
               obj = recipeListCollection.getItemAt(i);
               menuList += obj;
    I have tried various permutations of the event.target, but can't figure out how to access that variable.

    Create a custom event and stuff anything you want in there.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Datagrid Item Renderer not displaying correct data

    I have a datagrid that displays information from a web service, which is refreshed every 60 seconds.
    When the status is no 0 for a line a corresponding color is used to fill in the background.  I created a Item Renderer to fill in the background color.
    When the table is initially created, the colors are correct.  After the data is refreshed, then the background color value is carried over to the next row.
    The Spark DataGrid works better than the MX AdvancedDateGrid or DataGrid.  This was working in Flex 3, but I used an function which replaced the DataGridColumn that doesn't work in Flex 4.
    protected function init(event:FlexEvent):void
                    var showBackground:Boolean = false;
                    var backgroundColor:uint = new uint();
                    var labelTextColor:uint = new uint();
                    var dgListData:DataGridListData = listData as DataGridListData;
                    var dataGrid:DataGrid = dgListData.owner as DataGrid;
                    // comment this out if you want to see the background over the
                    // selection and highlight indicators
                    if (dataGrid.isItemSelected(data) || dataGrid.isItemHighlighted(data))
                        // clear the background so you can see the selection/highlight colors
                        showBackground = false;
                        return;
                    switch(data["MessageLevel"])
                        case 0:
                            showBackground = false;
                            backgroundColor = 0xFFFFFF;
                            labelTextColor = 0x000000;
                            break;
                        case 1:
                            showBackground = true;
                            backgroundColor = 0x00FF00;  // light green
                            labelTextColor = 0x000000;
                            break;
                        case 2:
                            showBackground = true;
                            backgroundColor = 0x015F00; // dark green
                            labelTextColor = 0xFFFFFF;
                            break;
                        case 3:
                            showBackground = true;
                            backgroundColor = 0xFDFF00; // yellow
                            labelTextColor = 0x000000;
                            break;
                        case 4:
                            showBackground = true;
                            backgroundColor = 0x7F6E3F; // tan
                            labelTextColor = 0xFFFFFF;
                            break;
                        case 5:
                            showBackground = true;
                            backgroundColor = 0xFF8A00; // orange;
                            labelTextColor = 0x000000;
                            break;
                        case 6:
                            showBackground = true;
                            backgroundColor = 0xFFDFE0; // rose
                            labelTextColor = 0x000000;
                            break;
                        case 7:
                            showBackground = true;
                            backgroundColor = 0xFF0000; //red
                            labelTextColor = 0xFFFFFF;
                            break;   
                    if(showBackground) {
                        var bgFill:SolidColor = new SolidColor();
                        bgFill.color = backgroundColor;
                        dataContainer.setStyle("backgroundColor",backgroundColor);
                        lblData.setStyle("color", labelTextColor);

    I added an "else" statement to make sure that a color was always added, even if the level was 0.  I also added a backgroundAlpha style to both, to turn the value off or on.
    So far, this seems to be the solution.
    if(showBackground) {
    var bgFill:SolidColor = new SolidColor();
    bgFill.color = backgroundColor;
    dataContainer.setStyle("backgroundColor",backgroundColor);
    labelDisplay.setStyle("color", labelTextColor);
    dataContainer.setStyle("backgroundAlpha",1);
    } else {
    dataContainer.setStyle("backgroundColor",backgroundColor);
    labelDisplay.setStyle("color", labelTextColor);
    dataContainer.setStyle("backgroundAlpha",0);

  • Strange Problem with datagrid item renderer in flash palyer 10

    Hi All
    In Flash player 10 when i use a text input as a item renderer in grid with a custom textinput skin , it does not show us the text , where as in flash player 11 it shows us. is there any work around for it or it's a bug.
    Plz help  me on this.

    The url works for me.  Please verify that you entered it correctly.  There are other sites that will verify your player version.  Search for them, pick one and report the results.
    Before you file a bug, it is probably best to do some investigation first to make sure it isn’t a known issue or an issue in your code.

  • DataGrid Horizontal Scroll Problem when datagrid contains Item renderer

    I have datagrid with horizontal scroll policy enabled. Grid
    contains some item renderer also.One of the item renderer is
    datefield when i select a date from the datefield and say the
    adjacent cell of the grid also contain datefield itemrenderer
    and i am selecting date from that itemrenderer also.When i
    scroll horizontally the date in the itemrender changes to any one
    of the two itemrenderer.Some time it works fine.I am getting the
    issue for combobox itemrender also.Can any one help me to solve
    this issue.

    "happybrowndog" <[email protected]> wrote in
    message
    news:ge11ag$jdo$[email protected]..
    >
    quote:
    Originally posted by:
    ravi_bharathii
    > I have datagrid with horizontal scroll policy enabled.
    Grid contains some
    > item
    > renderer also.One of the item renderer is datefield when
    i select a date
    > from
    > the datefield and say the adjacent cell of the grid also
    contain datefield
    > itemrenderer
    > and i am selecting date from that itemrenderer also.When
    i scroll
    > horizontally
    > the date in the itemrender changes to any one of the two
    itemrenderer.Some
    > time
    > it works fine.I am getting the issue for combobox
    itemrender also.Can any
    > one
    > help me to solve this issue.
    >
    > Ravi, I am having a similar problem. I subclass a
    TextInput as an
    > itemrenderer for a column in a datagrid. My subclassed
    TextInput checks
    > to see
    > the value in the overriden set() method, and depending
    on the value, sets
    > the
    > background color of the TextInput to green. When the
    datagrid scrolls
    > horizontally, some unrelated cell colors also change
    green and some of the
    > data
    > gets duplicated in the cells. The underlying data
    provider's data is not
    > confused however. Seems the rendering is screwed up when
    the Datagrid
    > scrolls.
    >
    > Did you find a solution to this problem? I think
    Datagrid is a piece of
    > screwed up code.
    http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
    Q2

  • Item renderer using action script

    Hi,
    Can anybody tell me how to use item renderers using actions script,
    I have a data grid and iam using item renderer in mxml works fine but it is causing memory issues >
    So i want to know to use item renderers in action script to avoid memory issue.
    Thank You,
    Anu

    use the ClassFactory
    example:
    <!-- MyCombo.mxml -->
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml" >
    </mx:ComboBox >
    and in ActionScript
    private var myComboFac:ClassFactory = new ClassFactory(MyCombo);
    private function myFunction():void
        colCombo.itemRenderer = myComboFac;  
    and in DataGrid
    <mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:columns>
            <mx:DataGridColumn id="colCombo" />
        </mx:columns>
    </mx:DataGrid>
    regards
    Leonardo França
    Adobe Certified Expert Flex 3 with AIR
    Adobe Certified Expert Rich Internet Application Specialist v1.0
    Adobe Certified Expert Flash CS3 Professional
    Certified Professional Adobe Flex 2 Developer
    Adobe Certified Professional Flash MX 2004 Developer
    http://www.leonardofranca.com
    http://twitter/leofederal
    Manager AUGDF - Adobe User Group do Distrito Federal
    http://www.augdf.com.br
    http://twitter/augdf
    anu3000 escreveu:
    Hi,
    Can anybody tell me how to use item renderers using actions script,
    I have a data grid and iam using item renderer in mxml works fine but it is causing memory issues >
    So i want to know to use item renderers in action script to avoid memory issue.
    Thank You,
    Anu
    >

  • Item Renderer complains about binding

    I have a data grid bound to an xml list. In the datagrid, I
    am using an item renderer:
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="270" height="80" verticalScrollPolicy="off"
    horizontalScrollPolicy="off">
    <mx:VBox width="100%" height="100%" verticalGap="0"
    paddingLeft="5" paddingTop="4" paddingRight="5"
    paddingBottom="5">
    <mx:Label id="title" text="{data.title}" width="100%"
    styleName="videoTitle"/>
    <mx:Text id="caption" text="{data.description}"
    width="100%" styleName="videoCaption"/>
    </mx:VBox>
    </mx:Canvas>
    It works fine, but if I debug it I get:
    warning: unable to bind to property 'title' on class 'XML'
    (class is not an IEventDispatcher)
    warning: unable to bind to property 'description' on class
    'XML' (class is not an IEventDispatcher)
    For each of my tiles. How do I make this go away?

    This is because "data" is really an "Object" containing the
    XML. While XML IS bindable (the warning is confusing) Object is
    not.
    The solution is to cast or convert the object ot XML:
    text="{XML(data).title}"
    Tracy

  • Item Renderer in a Datagrid

    I'm struggling with how to make a check mark ( image ) show
    up or not based on the value of some data in each datagrid line
    item. I'm using an item renderer but I'm missing something. Any
    help would be greatly appreciated.
    thanks,
    STeveR

    The following is my entire itemrenderer...please excuse any
    bad style as this is a WIProgress..
    Its probably easier to quote the adobe docs on listdata...If
    a component implements the IDropInListItemRenderer interface, you
    can use its listData property to obtain information about the data
    passed to the component when you use the component in an item
    renderer or item editor..I made sure the component implements the
    interface as you can see in the code at the top of component. Then
    add the couple of required functions regarding listdata, then you
    can access the listdata in your own functions in the renderer, like
    i do in set data function.
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    this line assigns the value from my datagrid to the renderers
    button label. (this renderer is a button that the user can press)
    so i want the buttons label to show the value coming in from the
    datagrid. So listdata is just a way to
    explicitly get the column name where the current data is
    being sourced from in your datagrid.As the grid is being rendered,
    it renders row by row. In each row it goes thru your columns . SO
    initially it for row 1 it would begin rendering firstname, surname,
    mark, average...etc etc. If i put an alert in on
    value[DataGridListData(listData).dataField
    I would see these column names popping up as they are getting
    rendered in the DGrid.
    Hope this helps...
    <!-- <?xml version="1.0" encoding="utf-8"?>-->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()" width="74" height="30"
    horizontalAlign="center" verticalAlign="middle"
    implements="mx.core.IFactory,mx.controls.listClasses.IDropInListItemRenderer">
    <mx:Metadata>
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.controls.DataGrid;
    import mx.utils.ArrayUtil;
    import mx.collections.ArrayCollection;
    import mx.collections.IViewCursor;
    import mx.controls.Alert;
    import mx.events.*;
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.containers.TitleWindow;
    private var panel:AssessmentMarkPopup = new
    AssessmentMarkPopup();
    var the_val = 0;
    var col_index:int;
    private var _listData:BaseListData;
    public function get listData() : BaseListData
    return _listData;
    public function set listData( value:BaseListData ) : void
    _listData = value;
    private function showLoginForm():void {
    var pop:AssessmentMarkPopup =
    AssessmentMarkPopup(PopUpManager.createPopUp(this,AssessmentMarkPopup,true));
    pop.addEventListener("closepopup",onClose);
    pop.TXT_***_mark.text = this.BTN_***_mark.label;
    var row:int =
    this.parentApplication.DG_class_students.selectedIndex;
    pop.student_name =
    this.parentApplication.DG_class_students.selectedItem.firstname + "
    " + this.parentApplication.DG_class_students.selectedItem.lastname;
    private function onClose(e:MyClosePopupEvent):void{
    this.BTN_***_mark.label = e.data.mark;
    public function newInstance():*
    return new MarkEntry();
    public override function get data():Object
    return super.data;
    override public function set data(value:Object):void {
    var dg:DataGrid = (listData) ? DataGrid(listData.owner) :
    null;
    var column:DataGridColumn = (dg) ?
    dg.columns[listData.columnIndex] as DataGridColumn : null;
    col_index = listData.columnIndex;
    var str:String = String(column.dataField);
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    ]]>
    </mx:Script>
    <mx:Button click="showLoginForm()" id="BTN_***_mark"
    width="52"/>
    </mx:VBox>

  • Item Renderer for DataGrid

    I have a button component as a Item renderer in the column of
    the datagrid .
    I am not able to access the Itemrenderer component(which I
    declared in other mxml file in the datagrid)
    This is the data grid where I have the Itemrenderer:
    <mx:DataGrid id="dgCondition1"
    variableRowHeight="true" width="100%" height="150"
    verticalScrollPolicy="auto" editable="true"
    dataProvider="{initDataGrid_Create}" >
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="conditi"
    />
    <mx:DataGridColumn headerText="Condition"
    dataField="syntax" width="300" />
    <mx:DataGridColumn headerText="1" dataField="value"
    width="80" editable="false" itemRenderer="buttonRenderer"/>
    <mx:DataGridColumn dataField="value" headerText="2"
    itemRenderer="buttonRenderer" />
    I created a new mxml component for this button component
    .(buttonRenderer.mxml)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="400" height="300">
    <mx:Script source="..TableDataGridBtn.as" />
    <mx:Button id="col1" label="" width="75"
    click="getDetail(event,col1)" />
    </mx:VBox>
    The Problem is I am not able to access the buttonRenderer in
    the datagrid itemRenderer tag .
    It says "Access of Undefined Property buttonRenderer".

    "nash99" <[email protected]> wrote in
    message
    news:g7alc5$nkd$[email protected]..
    > So
    > Is it that I can Use this ItemRenderer tag in the
    Application Tags only
    > Is there any other way I can use them in mxml components
    because I am
    > using
    > the same button in 16 datagrid columns , I dont wan't to
    make the code
    > look
    > redundant.
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=intro_3.html

  • Datagrid item renderer with drop down need help.

    Hi Guys,
    I am populating an advance data grid in which one column has an item renderer containing a drop down. This drop down has 4 items. When user selects more than one row the drop down should contain only two items. In my case when user selects multiple rows using control key and then clicks on any of the rows drop down then that row gets de selected which I don’t want I tried stop propagation and stop immediate propagation but that also didn’t helped. Please help
    Thanx
    Mahesh.

    Hi
      This is a default bahviour of dropdown.. dropdown will not allow you multiple selections.. you should create your own component by extending the combobox and try your thing,, If you click on one item.. then it calls internally change event. If the change event called then the dropdown will automatically closed.. so you should restrict this ...
    Thanks
    Ram

Maybe you are looking for